Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to maintain pixel when zooming into SVG canvas?

I've built a frontend tool for zooming in/out of an SVG canvas, but when I zoom, any 1px strokes increase in width (visually). Is there a svg setting that will ensure that 1px strokes remain 1px (visually) when zoomed? I remember reading about it somewhere, but can't find the resource.

like image 627
Steve Avatar asked Oct 07 '11 11:10

Steve


1 Answers

Try to add vector-effect="non-scaling-stroke" attribute to the path. Check HERE for details. Im guessing that's what you want?

like image 116
Cipi Avatar answered Sep 27 '22 19:09

Cipi