From 6c19059b373f46aed5161dfed3e9ce66aa599b20 Mon Sep 17 00:00:00 2001 From: dvlierop2 Date: Fri, 24 Apr 2009 20:31:23 +0000 Subject: [PATCH] Two minor snapping fixes --- src/object-snapper.cpp | 10 ++++++++-- src/sp-item.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 778928ae7..70377cb66 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -712,9 +712,15 @@ bool Inkscape::ObjectSnapper::ThisSnapperMightSnap() const return (_snap_enabled && _snapmanager->snapprefs.getSnapModeBBoxOrNodes() && snap_to_something); } -bool Inkscape::ObjectSnapper::GuidesMightSnap() const +bool Inkscape::ObjectSnapper::GuidesMightSnap() const // almost the same as ThisSnapperMightSnap above, but only looking at points (and not paths) { - bool snap_to_something = _snapmanager->snapprefs.getSnapToItemNode() || _snapmanager->snapprefs.getSnapToBBoxNode(); + bool snap_to_something = _snapmanager->snapprefs.getSnapToItemNode() + || _snapmanager->snapprefs.getSnapToPageBorder() + || (_snapmanager->snapprefs.getSnapModeBBox() && _snapmanager->snapprefs.getSnapToBBoxNode()) + || (_snapmanager->snapprefs.getSnapModeBBox() && (_snapmanager->snapprefs.getSnapBBoxEdgeMidpoints() || _snapmanager->snapprefs.getSnapBBoxMidpoints())) + || (_snapmanager->snapprefs.getSnapModeNode() && (_snapmanager->snapprefs.getSnapLineMidpoints() || _snapmanager->snapprefs.getSnapObjectMidpoints())) + || (_snapmanager->snapprefs.getSnapModeNode() && _snapmanager->snapprefs.getIncludeItemCenter()); + return (_snap_enabled && _snapmanager->snapprefs.getSnapModeGuide() && snap_to_something); } diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 996804cd3..ff3952c25 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -974,7 +974,7 @@ void sp_item_snappoints(SPItem const *item, bool const target, SnapPointsWithTyp // Get the snappoints at the item's center if (snapprefs != NULL && snapprefs->getIncludeItemCenter()) { - p.push_back(std::make_pair(item->getCenter(), target ? int(Inkscape::SNAPTARGET_OBJECT_MIDPOINT) : int(Inkscape::SNAPSOURCE_OBJECT_MIDPOINT))); + p.push_back(std::make_pair(item->getCenter(), target ? int(Inkscape::SNAPTARGET_ROTATION_CENTER) : int(Inkscape::SNAPSOURCE_ROTATION_CENTER))); } // Get the snappoints of clipping paths and mask, if any -- 2.30.2