In my app I'm drawing polygons using Canvas#drawPath. The polygons are stroked with a stroke width > 1.

In order to zoom in and out on the polygons I tried setting a scaling affine transform on the canvas, but this causes the stroke width to be scaled as well. At scale 1 and stroke width 5 the polygons are drawn 5px wide. At scale 2 they are drawn 10px wide.

I would like to keep the pixel width of the stroke constant regardless of zoom level. Is it recommended to do this by dividing the stroke width by the scale factor or by using the affine transform with Path#transform rather than applying it to the canvas itself? Does the canvas transformation get applied to other values besides stroke width as well? For instance font size...

Pepijn

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to