Search code examples
androidpathandroid-canvasandroid-custom-view

Prevent Path from closing even when end is at start point


Today I ran through a small problem, that is when I start a path and draw an arc from and to the starting point , the path gets closed and hence PathMeasurestarts giving me wrong data (at least according to what I need) when I need to split the arc to 6 parts and extract 6 points. To see what I mean check this

path.arcTo(...360f) gives blank

path.arcTo(...359.99f) gives somewhat near but it is still "mathematically" inaccurate enter image description here

What can I do ?


Solution

  • I solved it out by being a bit hacky to in arcTo as follows :

    enter image description here