summaryrefslogtreecommitdiffstats
path: root/src/seltrans.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2010-10-07 20:38:37 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2010-10-07 20:38:37 +0000
commitae65480e4089a909a979962fce9265ab44d05b47 (patch)
tree7b291b73471e943d18a9943110a076507fc1e11f /src/seltrans.cpp
parentGerman translation update (diff)
downloadinkscape-ae65480e4089a909a979962fce9265ab44d05b47.tar.gz
inkscape-ae65480e4089a909a979962fce9265ab44d05b47.zip
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)
Diffstat (limited to 'src/seltrans.cpp')
-rw-r--r--src/seltrans.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 7dbeb4173..9a1fdf4ad 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -1338,18 +1338,15 @@ gboolean Inkscape::SelTrans::rotateRequest(Geom::Point &pt, guint state)
// Move the item's transformation center
gboolean Inkscape::SelTrans::centerRequest(Geom::Point &pt, guint state)
{
- // Center is being dragged for the first item in the selection only
- // Find out which item is first ...
- GSList *items = (GSList *) const_cast<Selection *>(_selection)->itemList();
- SPItem *first = NULL;
- if (items) {
- first = reinterpret_cast<SPItem*>(g_slist_last(items)->data); // from the first item in selection
- }
- // ... and store that item because later on we need to make sure that
- // this transformation center won't snap to itself
SnapManager &m = _desktop->namedview->snap_manager;
m.setup(_desktop);
- m.setRotationCenterSource(first);
+
+ // When dragging the transformation center while multiple items have been selected, then those
+ // items will share a single center. While dragging that single center, it should never snap to the
+ // centers of any of the selected objects. Therefore we will have to pass the list of selected items
+ // to the snapper, to avoid self-snapping of the rotation center
+ GSList *items = (GSList *) const_cast<Selection *>(_selection)->itemList();
+ m.setRotationCenterSource(items);
m.freeSnapReturnByRef(pt, Inkscape::SNAPSOURCE_ROTATION_CENTER);
m.unSetup();