Code

Solve a snapping regression, which caused snapping of new items to (0,0) when there...
authordvlierop2 <dvlierop2@users.sourceforge.net>
Tue, 13 May 2008 19:10:22 +0000 (19:10 +0000)
committerdvlierop2 <dvlierop2@users.sourceforge.net>
Tue, 13 May 2008 19:10:22 +0000 (19:10 +0000)
src/context-fns.cpp

index 61b6a2fc492b686b12231ac8763c903d2c3844c4..2ae4c3901b8dd41968f9cdff67a959d1c867b06a 100644 (file)
@@ -196,8 +196,12 @@ NR::Rect Inkscape::snap_rectangular_box(SPDesktop const *desktop, SPItem *item,
 
         /* There's no constraint on the corner point, so just snap it to anything */
         p[0] = center;
+        p[1] = pt;
+        //std::cout << "pt        = " << pt << std::endl;
         snappoint = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, pt);
+        //std::cout << "snappoint.getPoint() = " << snappoint.getPoint() << std::endl;
         if (snappoint.getSnapped()) {
+            //std::cout << "we snapped here ..." << std::endl;
             p[1] = snappoint.getPoint();
         }
     }
@@ -208,6 +212,8 @@ NR::Rect Inkscape::snap_rectangular_box(SPDesktop const *desktop, SPItem *item,
 
     p[0] = sp_desktop_dt2root_xy_point(desktop, p[0]);
     p[1] = sp_desktop_dt2root_xy_point(desktop, p[1]);
+    
+    //std::cout << "after: p[0] vs. p[1] = " << p[0] << " | " << p[1] << std::endl;  
 
     return NR::Rect(NR::Point(MIN(p[0][NR::X], p[1][NR::X]), MIN(p[0][NR::Y], p[1][NR::Y])),
                     NR::Point(MAX(p[0][NR::X], p[1][NR::X]), MAX(p[0][NR::Y], p[1][NR::Y])));