From e182d3546498c8c865fb155481890c5571430c6f Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Tue, 14 Feb 2012 21:56:34 +0100 Subject: 1) Add checkboxes for perpendicular and tangential snapping to the document properties dialog (on the snap tab) 2) Newly created guides (dragged off the ruler) will take on the angle of the curve that's being snapped to (either perpendicularly or tangentialy, depending of the settings in the document properties dialog) (bzr r10975) --- src/snap.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/snap.h') diff --git a/src/snap.h b/src/snap.h index 8e7ab1872..3a8e18ad3 100644 --- a/src/snap.h +++ b/src/snap.h @@ -304,8 +304,14 @@ public: * PS: SnapManager::setup() must have been called before calling this method, * * @param p Current position of the point on the guide that is to be snapped; will be overwritten by the position of the snap target if snapping has occurred. + * @param origin_or_vector Data used for tangential and perpendicular snapping. When rotating a guide the origin of the rotation is specified here, whereas when + * dragging a guide its vector is specified here + * @param origin If true then origin_or_vector contains an origin, other it contains a vector + * @param freeze_angle If true (in which case origin is false), then the vector specified in origin_or_vector will not be touched, i.e. the guide will + * in all circumstances keep its angle. Otherwise the vector in origin_or_vector can be updated, meaning that the guide might take on the angle of a curve that + * has been snapped too tangentially or perpendicularly */ - void guideFreeSnap(Geom::Point &p, SPGuideDragType drag_type, boost::optional origin_or_vector = boost::optional()) const; + void guideFreeSnap(Geom::Point &p, Geom::Point &origin_or_vector, bool origin, bool freeze_angle) const; /** * Wrapper method to make snapping of the guide origin a bit easier (i.e. simplifies the calling code). @@ -313,10 +319,10 @@ public: * PS: SnapManager::setup() must have been called before calling this method, * * @param p Current position of the point on the guide that is to be snapped; will be overwritten by the position of the snap target if snapping has occurred. + * @param guideline The guide that is currently being dragged */ void guideConstrainedSnap(Geom::Point &p, SPGuide const &guideline) const; - /** * Apply a translation to a set of points and try to snap freely in 2 degrees-of-freedom. * -- cgit v1.2.3