Code

Snapping the transformation origin should also work for paths, not only for shapes
authordvlierop2 <dvlierop2@users.sourceforge.net>
Wed, 25 Jul 2007 12:07:39 +0000 (12:07 +0000)
committerdvlierop2 <dvlierop2@users.sourceforge.net>
Wed, 25 Jul 2007 12:07:39 +0000 (12:07 +0000)
src/selection.cpp
src/sp-item.cpp

index 44f601362e1494eedce9c43b9a8381d5e3be7391..2b143dd5a3f379c707be65604113fd2c2d84ed92 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "sp-shape.h"
 #include "sp-path.h"
+#include "sp-item-group.h"
 
 #include <sigc++/functors/mem_fun.h>
 
@@ -382,6 +383,9 @@ std::vector<NR::Point> Selection::getSnapPoints() const {
             // (Same check occurs in sp-item-group)
             sp_item_snappoints(this_item, SnapPointsIter(p));
         }
+        //Include the transformation origin for snapping
+        //For a group only the group's origin is considered
+        p.push_back(this_item->getCenter());  
     }
 
     return p;
index 469b95222cba39a74e921de55a31113367bae5a6..309c42c906c5d9b5dbf8c8a9e91bc5062b7ec4e5 100644 (file)
@@ -787,8 +787,6 @@ void sp_item_snappoints(SPItem const *item, SnapPointsIter p)
     if (item_class.snappoints) {
         item_class.snappoints(item, p);
     }
-    
-    *p = item->getCenter();
 }
 
 void