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

Scaling Matrix setting stroke width to 1000 pts?!

New Here ,
Aug 03, 2020 Aug 03, 2020

Copy link to clipboard

Copied

 Good day everyone!

This one thing is kind of surprising for me and I don't get why it happens.

When I run a scaling matrix on a shape or a group of shapes, the stroke width is set to 1000pts after transformation... whether I scale up or down, whatever the original width of the stroke. This makes no sense to me...

 

If you want to try for yourself and see if does the same, here's my test script line (whatever the scaling number, the issue happens):

 

activeDocument.selection[0].transform(app.getScaleMatrix(125,125))

 

So, is it a bug? I could understand that the scaling matrix wouldn't scale the stroke, and I woud know how to work around that in my scripts, but this is really absurd.

 

Thanks for your insight on this everyone!

TOPICS
Bug , Scripting

Views

439

Translate

Translate

Report

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 , Aug 03, 2020 Aug 03, 2020

changeLineWidths is optional but I think if not provided, it defaults to 100.

 

if you don't want to scale strokes, use a value of 1, otherwise calculate the exact value.

 

var scaleX = 200;
var scaleY = 200;

var changeLineWidths = ((scaleX+scaleY)/2)/100;

activeDocument.selection[0].transform(app.getScaleMatrix(scaleX, scaleY), true, true, true, true, changeLineWidths, Transformation.CENTER);

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 03, 2020 Aug 03, 2020

Copy link to clipboard

Copied

changeLineWidths is optional but I think if not provided, it defaults to 100.

 

if you don't want to scale strokes, use a value of 1, otherwise calculate the exact value.

 

var scaleX = 200;
var scaleY = 200;

var changeLineWidths = ((scaleX+scaleY)/2)/100;

activeDocument.selection[0].transform(app.getScaleMatrix(scaleX, scaleY), true, true, true, true, changeLineWidths, Transformation.CENTER);

Votes

Translate

Translate

Report

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
New Here ,
Aug 04, 2020 Aug 04, 2020

Copy link to clipboard

Copied

Hi @CarlosCanto, thanks a lot for the reply!

Okay, so I really get how the function works, the documentation wasn't really clear on what the booleans do and the changeLineWidth (they should provide the default values in the Javascript Reference!).
Thanks a lot again, everything "clicked" for me now.

Votes

Translate

Translate

Report

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 Expert ,
Aug 04, 2020 Aug 04, 2020

Copy link to clipboard

Copied

LATEST

I hear you, the guides don't explain this part and others. Luckily the awesome community has figured out most of the intricate parts.

Votes

Translate

Translate

Report

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