Code

fix bug: selected group gets moved even when click+drag on an object on top of it
authorbuliabyak <buliabyak@users.sourceforge.net>
Fri, 8 Feb 2008 07:43:22 +0000 (07:43 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Fri, 8 Feb 2008 07:43:22 +0000 (07:43 +0000)
src/select-context.cpp

index 0eb5777cf609cd27366315eff8161fa356e5f484..13cb042cd567e7dc3059f321df649364714f458e 100644 (file)
@@ -505,6 +505,14 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
                         if (!sc->moved) {
                             item_in_group = desktop->item_at_point(NR::Point(event->button.x, event->button.y), TRUE);
                             group_at_point = desktop->group_at_point(NR::Point(event->button.x, event->button.y));
+
+                            // group-at-point is meant to be topmost item if it's a group, 
+                            // not topmost group of all items at point
+                            if (group_at_point != item_in_group && 
+                                !(group_at_point && item_at_point && 
+                                  group_at_point->isAncestorOf(item_at_point)))
+                                group_at_point = NULL;
+
                             // if neither a group nor an item (possibly in a group) at point are selected, set selection to the item at point
                             if ((!item_in_group || !selection->includes(item_in_group)) &&
                                 (!group_at_point || !selection->includes(group_at_point))