Selection in java 2d

I use java2d to draw a simple graph at the moment when I implemented call collection, it contains (MousePoint) for each object / form, it works, but it scales linearly.

Is there a more efficient method for choosing in java2d?

+3
source share
2 answers

Yes, although the full answer will be too long for this space.

First of all, if you do not have a large number of nodes, then the linear one is likely to be beautiful, and you should not change anything if the performance does not suffer anymore.

-, , , - , quadtree. ( , ), " ". , "" ", Christer Ericson.

+4

(, ), contains(). , , , . , , , .

contains() , Line2D. , contains() false. SO .

+1

Source: https://habr.com/ru/post/1725059/


All Articles