Code

Two minor snapping fixes
authordvlierop2 <dvlierop2@users.sourceforge.net>
Fri, 24 Apr 2009 20:31:23 +0000 (20:31 +0000)
committerdvlierop2 <dvlierop2@users.sourceforge.net>
Fri, 24 Apr 2009 20:31:23 +0000 (20:31 +0000)
src/object-snapper.cpp
src/sp-item.cpp

index 778928ae75c4fa3ced5562728bc1dd8113bc05a1..70377cb661fe77f22dafc401387a90b72e359216 100644 (file)
@@ -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);
 }
 
index 996804cd3a5c4001c1df381da035fb8ce686f194..ff3952c25995c766a82ce004f4dad4197811afa2 100644 (file)
@@ -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