From: dvlierop2 Date: Tue, 13 May 2008 19:10:22 +0000 (+0000) Subject: Solve a snapping regression, which caused snapping of new items to (0,0) when there... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6cdc566e1cf6cc68afa1c2fec60634e18bd0d5c6;p=inkscape.git Solve a snapping regression, which caused snapping of new items to (0,0) when there was in fact nothing to snap to... --- diff --git a/src/context-fns.cpp b/src/context-fns.cpp index 61b6a2fc4..2ae4c3901 100644 --- a/src/context-fns.cpp +++ b/src/context-fns.cpp @@ -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])));