How to disable scaling for stroke width (#tilPost)

Today I came across the caniuse.com entry for vector-effect: non-scaling-stroke. Using vector-effect you can control if transformation such as scale should be applied to the stroke width, too. If you define vector-effect="non-s…


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

Today I came across the caniuse.com entry for vector-effect: non-scaling-stroke. Using vector-effect you can control if transformation such as scale should be applied to the stroke width, too. If you define vector-effect="non-scaling-stroke" you can guarantee that the stroke width stays the same no matter which transformations are applied. This functionality can be useful when you're building interactive SVG animations.

Learn more about it by playing with the demo below. You can change the scale value and find out that the stroke width scales on the x and y axis, too. Change vector-effect to non-scaling-stroke and see that the stroke width stays the same. ?

Read more about vector-effect on MDN. Have fun and happy scaling!


Reply to Stefan


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis


Print Share Comment Cite Upload Translate Updates
APA

Stefan Judis | Sciencx (2021-04-26T22:00:00+00:00) How to disable scaling for stroke width (#tilPost). Retrieved from https://www.scien.cx/2021/04/26/how-to-disable-scaling-for-stroke-width-tilpost/

MLA
" » How to disable scaling for stroke width (#tilPost)." Stefan Judis | Sciencx - Monday April 26, 2021, https://www.scien.cx/2021/04/26/how-to-disable-scaling-for-stroke-width-tilpost/
HARVARD
Stefan Judis | Sciencx Monday April 26, 2021 » How to disable scaling for stroke width (#tilPost)., viewed ,<https://www.scien.cx/2021/04/26/how-to-disable-scaling-for-stroke-width-tilpost/>
VANCOUVER
Stefan Judis | Sciencx - » How to disable scaling for stroke width (#tilPost). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/26/how-to-disable-scaling-for-stroke-width-tilpost/
CHICAGO
" » How to disable scaling for stroke width (#tilPost)." Stefan Judis | Sciencx - Accessed . https://www.scien.cx/2021/04/26/how-to-disable-scaling-for-stroke-width-tilpost/
IEEE
" » How to disable scaling for stroke width (#tilPost)." Stefan Judis | Sciencx [Online]. Available: https://www.scien.cx/2021/04/26/how-to-disable-scaling-for-stroke-width-tilpost/. [Accessed: ]
rf:citation
» How to disable scaling for stroke width (#tilPost) | Stefan Judis | Sciencx | https://www.scien.cx/2021/04/26/how-to-disable-scaling-for-stroke-width-tilpost/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.