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?
Style Stroke Width problem
Moderators: Víctor Paredes, Belgarath, slowtiger
- synthsin75
- Posts: 9968
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Style Stroke Width problem
Try multiplying the 'fLineWidth' by: moho.document:Height()
Style width is scaled to the project dimensions.
Style width is scaled to the project dimensions.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: Style Stroke Width problem
Perfect! When setting the fLineWidth, I just need to take the new input and divide it by the document height. Thanks, Wes.
- synthsin75
- Posts: 9968
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Style Stroke Width problem
No problem. Luckily I had to do this recently, so it was still fresh in my mind.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/