Page 1 of 1

Style Stroke Width problem

Posted: Sat May 26, 2018 4:10 am
by dkwroot
When looking at the 'M_Style' class, I noticed that the property 'fLineWidth' doesn't match the width in the UI. For example, when I give a shape a width of 4 in the UI and then print 'fLineWidth' for the style, I get 0.005555...

What I'm trying to do, is set the style stroke style width using a script, but I'm having trouble do to this issue. Am I accessing the style width incorrectly or is there a specific function that I should use?

Re: Style Stroke Width problem

Posted: Sat May 26, 2018 4:20 am
by synthsin75
Try multiplying the 'fLineWidth' by: moho.document:Height()

Style width is scaled to the project dimensions.

Re: Style Stroke Width problem

Posted: Sat May 26, 2018 4:24 am
by dkwroot
Perfect! When setting the fLineWidth, I just need to take the new input and divide it by the document height. Thanks, Wes.

Re: Style Stroke Width problem

Posted: Sat May 26, 2018 4:27 am
by synthsin75
No problem. Luckily I had to do this recently, so it was still fresh in my mind.