Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can i shear rectangle to JavaScript?

Community Beginner ,
Jul 03, 2013 Jul 03, 2013

shear.jpg

How can i shear rectangle?

there is similar question.

(http://forums.adobe.com/message/1103495#1103495)

 

But i can't understand answer in there.

 

JavaScript Reference has 'getRotationMatrix', 'getScaleMatrix', 'getTranslationMatrix'.

But there is NOT 'getShearMatrix'!!

how i can shear rectangle?

if you can as javascript, show me your code please.

thank you.

TOPICS
Scripting
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 04, 2013 Jul 04, 2013

use the Matrix properties b & c, the actual skewing values are in percentages of the objects dimensions, not degrees as in the UI...if you need angle values, that would be your homework.

draw a rectangle, select it and run the script to skew or shear 50%

// skew or shear selection, carlos canto 07/04/13

// http://forums.adobe.com/message/5475881#5475881

var idoc = app.activeDocument;

var sel = idoc.selection[0];

var im = app.getIdentityMatrix();

//im.mValueB = .5; // skew y 50%

im.mValueC = .5; // skew

...
Translate
Adobe
Community Expert ,
Jul 04, 2013 Jul 04, 2013

use the Matrix properties b & c, the actual skewing values are in percentages of the objects dimensions, not degrees as in the UI...if you need angle values, that would be your homework.

draw a rectangle, select it and run the script to skew or shear 50%

// skew or shear selection, carlos canto 07/04/13

// http://forums.adobe.com/message/5475881#5475881

var idoc = app.activeDocument;

var sel = idoc.selection[0];

var im = app.getIdentityMatrix();

//im.mValueB = .5; // skew y 50%

im.mValueC = .5; // skew x 50%

sel.transform (im, true, true, true, true, 1, undefined);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 04, 2013 Jul 04, 2013
LATEST

Thank you! thats all i want

You helpful to me.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines