Sunday 18 August 2013

how to calculate a path to take into account the stroke width?

how to calculate a path to take into account the stroke width?

I'm painting a dynamic line on a Canvas object using
canvas.drawPath(path, paint);
I have a rather large stroke width. And the stroke width is distributed
equally to both side of the path. So if I set the B point of my path on
the edge of my view, pixels are painted outside of my view.

Additionally, the path continues to point C. And this path may have even
more rotation, pushing to top-most pixel even higher!
How do I calculate the position of point B to take account of the stroke
size on a path from A to B and from B to C?

No comments:

Post a Comment