diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2008-05-12 18:58:04 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2008-05-12 18:58:04 +0000 |
| commit | de27d953d1c13d2e7563b43c2d959b1b02aee9c3 (patch) | |
| tree | efc8ed7eaba9a2b0ed87eaf14b797103bd8fa33a /src/snapped-point.cpp | |
| parent | fix typo (diff) | |
| download | inkscape-de27d953d1c13d2e7563b43c2d959b1b02aee9c3.tar.gz inkscape-de27d953d1c13d2e7563b43c2d959b1b02aee9c3.zip | |
Add a centralized check (i.e. in the snapper mechanism) whether we've snapped or not, instead of leaving it up to the various tools. This should prevent these tools from moving to (0,0) if they bluntly use the value returned by the snapping mechanism without checking whether snapping has really occured.
(bzr r5659)
Diffstat (limited to 'src/snapped-point.cpp')
| -rw-r--r-- | src/snapped-point.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/snapped-point.cpp b/src/snapped-point.cpp index 4e5ca836d..02f7ed165 100644 --- a/src/snapped-point.cpp +++ b/src/snapped-point.cpp @@ -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 |
