Finding Points contained in a Path in Android

前端 未结 4 2315
情深已故
情深已故 2020-12-13 02:51

Is there a reason that they decided not to add the contains method (for Path) in Android?

I\'m wanting to know what points I have in a Path and hoped it was easier t

4条回答
  •  执笔经年
    2020-12-13 03:52

    I would just like to comment on @theisenp answer: The code has integer arrays and if you look on the algorithm description webpage it warns against using integers instead of floating point.

    I copied your code above and it seemed to work fine except for some corner cases when I made lines that didnt connect to themselves very well.

    By changing everything to floating point, I got rid of this bug.

提交回复
热议问题