From ae65480e4089a909a979962fce9265ab44d05b47 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Thu, 7 Oct 2010 22:38:37 +0200 Subject: Fix self-snapping when dragging the transformation center of a selection containing multiple items (as reported by LucaDC in LP #607107, comment #30) (bzr r9817) --- src/object-snapper.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/object-snapper.cpp') diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index f1bdd94d9..b11e857dc 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -229,10 +229,17 @@ void Inkscape::ObjectSnapper::_collectNodes(Inkscape::SnapSourceType const &t, _snapmanager->snapprefs.setSnapIntersectionCS(false); } + // We should not snap a transformation center to any of the centers of the items in the + // current selection (see the comment in SelTrans::centerRequest()) bool old_pref2 = _snapmanager->snapprefs.getIncludeItemCenter(); - if ((*i).item == _snapmanager->getRotationCenterSource()) { - // don't snap to this item's rotation center - _snapmanager->snapprefs.setIncludeItemCenter(false); + if (old_pref2) { + for ( GSList const *itemlist = _snapmanager->getRotationCenterSource(); itemlist != NULL; itemlist = g_slist_next(itemlist) ) { + if ((*i).item == reinterpret_cast(itemlist->data)) { + // don't snap to this item's rotation center + _snapmanager->snapprefs.setIncludeItemCenter(false); + break; + } + } } sp_item_snappoints(root_item, *_points_to_snap_to, &_snapmanager->snapprefs); -- cgit v1.2.3