![](https://secure.gravatar.com/avatar/b47d036b8f12e712f4960ba78404c3b2.jpg?s=120&d=mm&r=g)
2010/2/8 Alex Leone <acleone@...400...>:
Anyway, can someone explain:
- What handles click events on the canvas
- Where is the logic that decides what gets selected
The function that selects the object under the cursor is at event-context.cpp:1079. Through some indirection it calls the find_item_at_point at document.cpp:1197 and this in turn calls nr_arena_item_invoke_pick at display/nr-arena-item.cpp:635 which calls a GObject virtual function; for shapes it executes nr_arena_shape_pick at display/nr-arena-shape.cpp:1078.
You need to insert the fix into find_item_at_point by also testing the mask and clip, either using another call to nr_arena_shape_pick or some other method. Note that while masks can be tested in the usual way, for clippaths you need to treat them as filled and unstroked regardless of their actual style. This requires adding an extra parameter to the virtual functions.
Regards, Krzysztof