diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2007-11-18 19:14:14 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2007-11-18 19:14:14 +0000 |
| commit | 442bc01e1a2fc6f7e59fd6b8e70d609d3d0cce6d (patch) | |
| tree | 9353857defadc3d3d38cf4f32f72541b5649c6e5 /src/snapped-point.h | |
| parent | rename EditCloneOriginal to EditCloneSelectOriginal (diff) | |
| download | inkscape-442bc01e1a2fc6f7e59fd6b8e70d609d3d0cce6d.tar.gz inkscape-442bc01e1a2fc6f7e59fd6b8e70d609d3d0cce6d.zip | |
1) Improving snapping logic 2) When skewing, don't snap to selection itself
(bzr r4111)
Diffstat (limited to 'src/snapped-point.h')
| -rw-r--r-- | src/snapped-point.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/snapped-point.h b/src/snapped-point.h index 4d8751f5f..e4b08a302 100644 --- a/src/snapped-point.h +++ b/src/snapped-point.h @@ -7,6 +7,7 @@ * * Authors: * Mathieu Dimanche <mdimanche@free.fr> + * Diederik van Lierop <mail@diedenrezi.nl> * * Released under GNU GPL, read the file 'COPYING' for more information. */ @@ -15,6 +16,7 @@ #include <list> #include "libnr/nr-coord.h" #include "libnr/nr-point.h" +#include <libnr/nr-values.h> namespace Inkscape { @@ -24,17 +26,28 @@ class SnappedPoint { public: SnappedPoint(); - SnappedPoint(::NR::Point p, ::NR::Coord d, bool at_intersection = false); + SnappedPoint(::NR::Point p, ::NR::Coord d, bool at_intersection = false, NR::Coord d2 = NR_HUGE); ~SnappedPoint(); NR::Coord getDistance() const; + NR::Coord getSecondDistance() const; NR::Point getPoint() const; bool getAtIntersection() const {return _at_intersection;} protected: - NR::Coord _distance; - NR::Point _point; - bool _at_intersection; + NR::Point _point; // Location of the snapped point + bool _at_intersection; // If true, the snapped point is at an intersection + + /* Distance from original point to snapped point. If the snapped point is at + an intersection of e.g. two lines, then this is the distance to the closest + line */ + NR::Coord _distance; + + /* If the snapped point is at an intersection of e.g. two lines, then this is + the distance to the fartest line */ + NR::Coord _second_distance; + + }; } |
