diff options
| author | Carl Hetherington <cth@carlh.net> | 2006-05-05 14:22:41 +0000 |
|---|---|---|
| committer | cth103 <cth103@users.sourceforge.net> | 2006-05-05 14:22:41 +0000 |
| commit | b0bda995cebf5befd80a735796661fb670eca179 (patch) | |
| tree | 374d96842b1befddde6bb2dc503b1700535982b2 /src/snap.h | |
| parent | remove overdefinition (diff) | |
| download | inkscape-b0bda995cebf5befd80a735796661fb670eca179.tar.gz inkscape-b0bda995cebf5befd80a735796661fb670eca179.zip | |
Various snapping cleanups and bug fixes.
(bzr r734)
Diffstat (limited to 'src/snap.h')
| -rw-r--r-- | src/snap.h | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/src/snap.h b/src/snap.h index c77e8df41..a37878f9c 100644 --- a/src/snap.h +++ b/src/snap.h @@ -29,7 +29,7 @@ class SPNamedView; class SnapManager { public: - SnapManager(SPNamedView* v); + SnapManager(SPNamedView const *v); bool willSnapSomething() const; @@ -43,12 +43,12 @@ public: Inkscape::SnappedPoint constrainedSnap(Inkscape::Snapper::PointType t, NR::Point const &p, - NR::Point const &c, + Inkscape::Snapper::ConstraintLine const &c, SPItem const *it) const; Inkscape::SnappedPoint constrainedSnap(Inkscape::Snapper::PointType t, NR::Point const &p, - NR::Point const &c, + Inkscape::Snapper::ConstraintLine const &c, std::list<SPItem const *> const &it) const; std::pair<NR::Point, bool> freeSnapTranslation(Inkscape::Snapper::PointType t, @@ -58,16 +58,46 @@ public: std::pair<NR::Point, bool> constrainedSnapTranslation(Inkscape::Snapper::PointType t, std::vector<NR::Point> const &p, - NR::Point const &c, std::list<SPItem const *> const &it, + Inkscape::Snapper::ConstraintLine const &c, NR::Point const &tr) const; + std::pair<NR::scale, bool> freeSnapScale(Inkscape::Snapper::PointType t, + std::vector<NR::Point> const &p, + std::list<SPItem const *> const &it, + NR::scale const &s, + NR::Point const &o) const; + + std::pair<NR::scale, bool> constrainedSnapScale(Inkscape::Snapper::PointType t, + std::vector<NR::Point> const &p, + std::list<SPItem const *> const &it, + Inkscape::Snapper::ConstraintLine const &c, + NR::scale const &s, + NR::Point const &o) const; + Inkscape::GridSnapper grid; Inkscape::GuideSnapper guide; Inkscape::ObjectSnapper object; typedef std::list<const Inkscape::Snapper*> SnapperList; SnapperList getSnappers() const; + +private: + + enum Transformation + { + TRANSLATION, + SCALE + }; + + std::pair<NR::Point, bool> _snapTransformed(Inkscape::Snapper::PointType type, + std::vector<NR::Point> const &points, + std::list<SPItem const *> const &ignore, + bool constrained, + Inkscape::Snapper::ConstraintLine const &constraint, + Transformation transformation_type, + NR::Point const &transformation, + NR::Point const &origin) const; }; @@ -89,6 +119,7 @@ std::pair<double, bool> namedview_vector_snap_list(SPNamedView const *nv, std::list<SPItem const *> const &it ); + std::pair<double, bool> namedview_dim_snap_list_scale(SPNamedView const *nv, Inkscape::Snapper::PointType t, const std::vector<NR::Point> &p, NR::Point const &norm, double const sx, |
