Hi everyone,
I spent a lot of time this weekend trying to wrap my head around how an object gets selected to no avail. My goal is to fix this bug: https://bugs.launchpad.net/inkscape/+bug/365458
Currently selection of clipped objects is horribly broken - see http://launchpadlibrarian.net/31755891/clip-selection-bug.ogv
Anyway, can someone explain: 1. What handles click events on the canvas 2. Where is the logic that decides what gets selected
From what I can tell, display/sp-canvas.cpp:1505 sp_canvas_button
(GtkWidget *widget, GdkEventButton *event) handles click events. Within this function I don't see any calls to anything that resembles "is this point within this object".
Help! Thanks! - Alex
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
participants (2)
-
Alex Leone
-
Krzysztof Kosiński