How to select the drawing object under the mouse cursor in a drawing application?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Behrang_Saeedzadeh
Posted On:   Sunday, February 24, 2002 06:46 AM

I want to design a program for drawing Graphs on it that contains nodes and edges.

I want to be able to select the object under the mouse cursor when I press the mouse button. How can I do this efficiently?

I can put the objects I have inserted in the drawing space into a list and then call the contains(int x, int y) method on them to see if they contain the point where the mouse is clicked on, but I think this is not efficient enough if I have a large drawing?

Does anybody know any better method so I can enhance my program?

Thanks in advance.

About | Sitemap | Contact