How to select a line

后端 未结 4 1228
一个人的身影
一个人的身影 2020-12-07 04:40

So I\'m trying to figure out how to implement a method of selecting lines or edges in a drawing area but my math is a bit lacking. This is what I got so far:

  • A
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 05:14

    If you use the 2D api then this is already taken care of.

    You can use Line2D.Double class to represent the lines. The Line2D.Double class has a contains() method that tells you if a Point is onthe line or not.

提交回复
热议问题