Code

plumb XML::Documents in everywhere
[inkscape.git] / src / snapped-point.cpp
index 4e5ca836daa957905e84852a3616b946b1a077f2..02f7ed165b0cf25b83c71e0f5651bb6565e4dd6b 100644 (file)
@@ -80,9 +80,13 @@ bool Inkscape::SnappedPoint::getSecondAlwaysSnap() const
 }
 
 
-NR::Point Inkscape::SnappedPoint::getPoint() const
+void Inkscape::SnappedPoint::getPoint(NR::Point &p) const
 {
-    return _point;
+    // When we have snapped
+    if (getSnapped()) { 
+        // then return the snapped point by overwriting p
+        p = _point;
+    } //otherwise p will be left untouched; this way the caller doesn't have to check wether we've snapped
 }
 
 // search for the closest snapped point