X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsnapped-point.h;h=b2a9fa1ce02d7b2698c7beeeccbf9f479b673f69;hb=df44b6baca018000107cdde0c3613ff3bbc53742;hp=05e954e1e4ea6aaeb18a73ad0872f41ccb8936e9;hpb=9eabcb72755c832cc1667e7a25570f763cb96a7e;p=inkscape.git diff --git a/src/snapped-point.h b/src/snapped-point.h index 05e954e1e..b2a9fa1ce 100644 --- a/src/snapped-point.h +++ b/src/snapped-point.h @@ -48,13 +48,15 @@ public: * to, because it only returns a point if snapping has actually occurred * (by overwriting p) */ - void getPoint(Geom::Point &p) const; + void getPointIfSnapped(Geom::Point &p) const; /* This method however always returns a point, even if no snapping * has occurred; A check should be implemented in the calling code * to check for snapping. Use this method only when really needed, e.g. * when the calling code is trying to snap multiple points and must - * determine itself which point is most appropriate + * determine itself which point is most appropriate, or when doing a + * constrainedSnap that also enforces projection onto the constraint (in + * which case you need the new point anyway, even if we didn't snap) */ Geom::Point getPoint() const {return _point;} void setPoint(Geom::Point const &p) {_point = p;} @@ -95,7 +97,7 @@ public: protected: Geom::Point _point; // Location of the snapped point SnapSourceType _source; // Describes what snapped - long _source_num; // Sequence number of the source point that snapped, if that point is part of a set of points. (starting at zero) + long _source_num; // Sequence number of the source point that snapped, if that point is part of a set of points. (starting at zero if we might have a set of points; -1 if we only have a single point) SnapTargetType _target; // Describes to what we've snapped to bool _at_intersection; // If true, the snapped point is at an intersection bool _constrained_snap; // If true, then the snapped point was found when looking for a constrained snap