From 407b5ecb1fb88dd7d37bb1c521b33fe7f1923b50 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Fri, 8 Feb 2008 07:43:22 +0000 Subject: [PATCH] fix bug: selected group gets moved even when click+drag on an object on top of it --- src/select-context.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/select-context.cpp b/src/select-context.cpp index 0eb5777cf..13cb042cd 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -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)) -- 2.30.2