Highlighted

Scaling Matrix setting stroke width to 1000 pts?!

New Here ,
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!

Adobe Community Professional
Correct answer by CarlosCanto | Adobe Community Professional

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);
TOPICS
Bug, Scripting

Views

56

Likes

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

Scaling Matrix setting stroke width to 1000 pts?!

New Here ,
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!

Adobe Community Professional
Correct answer by CarlosCanto | Adobe Community Professional

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);
TOPICS
Bug, Scripting

Views

57

Likes

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
Aug 03, 2020 0
Adobe Community Professional ,
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);

Likes

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
Reply
Loading...
Aug 03, 2020 1
New Here ,
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.

Likes

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
Reply
Loading...
Aug 04, 2020 0
Adobe Community Professional ,
Aug 04, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Aug 04, 2020 0