diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2009-01-31 13:51:52 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2009-01-31 13:51:52 +0000 |
| commit | 07d32ff9bade493f2549e8e90c32d11ba12b199d (patch) | |
| tree | e23af978f1919af10ac80d315f90d8323bb2d0ee /src/object-snapper.h | |
| parent | * [INTL:pl] Further small updates to the Polish translation (diff) | |
| download | inkscape-07d32ff9bade493f2549e8e90c32d11ba12b199d.tar.gz inkscape-07d32ff9bade493f2549e8e90c32d11ba12b199d.zip | |
Store the snapper tolerances in the snap-preferences instead of in each snapper individualy. This way we don't have to update all snappers when the namedview has been updated (and we can get rid of the _update_snap_distances() call)
(bzr r7208)
Diffstat (limited to 'src/object-snapper.h')
| -rw-r--r-- | src/object-snapper.h | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/object-snapper.h b/src/object-snapper.h index 9c391a90f..74bdec0ce 100644 --- a/src/object-snapper.h +++ b/src/object-snapper.h @@ -46,38 +46,41 @@ class ObjectSnapper : public Snapper { public: - ObjectSnapper(SnapManager *sm, Geom::Coord const d); + ObjectSnapper(SnapManager *sm, Geom::Coord const d); ~ObjectSnapper(); - enum DimensionToSnap { - GUIDE_TRANSL_SNAP_X, // For snapping a vertical guide (normal in the X-direction) to objects, - GUIDE_TRANSL_SNAP_Y, // For snapping a horizontal guide (normal in the Y-direction) to objects - ANGLED_GUIDE_TRANSL_SNAP, // For snapping an angled guide, while translating it accross the desktop - ANGLED_GUIDE_ROT_SNAP, // For snapping an angled guide, while rotating it around some pivot point - TRANSL_SNAP_XY}; // All other cases; for snapping to objects, other than guides - - void guideSnap(SnappedConstraints &sc, - Geom::Point const &p, - Geom::Point const &guide_normal) const; - - bool ThisSnapperMightSnap() const; - bool GuidesMightSnap() const; - - void freeSnap(SnappedConstraints &sc, - Inkscape::SnapPreferences::PointType const &t, - Geom::Point const &p, - bool const &first_point, - Geom::OptRect const &bbox_to_snap, - std::vector<SPItem const *> const *it, - std::vector<Geom::Point> *unselected_nodes) const; - - void constrainedSnap(SnappedConstraints &sc, - Inkscape::SnapPreferences::PointType const &t, - Geom::Point const &p, - bool const &first_point, - Geom::OptRect const &bbox_to_snap, - ConstraintLine const &c, - std::vector<SPItem const *> const *it) const; + enum DimensionToSnap { + GUIDE_TRANSL_SNAP_X, // For snapping a vertical guide (normal in the X-direction) to objects, + GUIDE_TRANSL_SNAP_Y, // For snapping a horizontal guide (normal in the Y-direction) to objects + ANGLED_GUIDE_TRANSL_SNAP, // For snapping an angled guide, while translating it accross the desktop + ANGLED_GUIDE_ROT_SNAP, // For snapping an angled guide, while rotating it around some pivot point + TRANSL_SNAP_XY}; // All other cases; for snapping to objects, other than guides + + void guideSnap(SnappedConstraints &sc, + Geom::Point const &p, + Geom::Point const &guide_normal) const; + + bool ThisSnapperMightSnap() const; + bool GuidesMightSnap() const; + + Geom::Coord getSnapperTolerance() const; //returns the tolerance of the snapper in screen pixels (i.e. independent of zoom) + bool getSnapperAlwaysSnap() const; //if true, then the snapper will always snap, regardless of its tolerance + + void freeSnap(SnappedConstraints &sc, + Inkscape::SnapPreferences::PointType const &t, + Geom::Point const &p, + bool const &first_point, + Geom::OptRect const &bbox_to_snap, + std::vector<SPItem const *> const *it, + std::vector<Geom::Point> *unselected_nodes) const; + + void constrainedSnap(SnappedConstraints &sc, + Inkscape::SnapPreferences::PointType const &t, + Geom::Point const &p, + bool const &first_point, + Geom::OptRect const &bbox_to_snap, + ConstraintLine const &c, + std::vector<SPItem const *> const *it) const; private: //store some lists of candidates, points and paths, so we don't have to rebuild them for each point we want to snap |
