diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2008-09-07 15:12:57 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2008-09-07 15:12:57 +0000 |
| commit | 63d732ef4c6d3ee46fc743768274d407de6f876a (patch) | |
| tree | 9e4231bab7970e0525ec69029c468da8e5e5b3cc /src/guide-snapper.cpp | |
| parent | Remove pointer to SPDesktop from ObjectSnapper (diff) | |
| download | inkscape-63d732ef4c6d3ee46fc743768274d407de6f876a.tar.gz inkscape-63d732ef4c6d3ee46fc743768274d407de6f876a.zip | |
If a snapper needs a reference to a SPNamedView or a SPDesktop, then get that reference via the SnapManager (instead of storing references in the snapper and accessing them directly)
(bzr r6773)
Diffstat (limited to 'src/guide-snapper.cpp')
| -rw-r--r-- | src/guide-snapper.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/guide-snapper.cpp b/src/guide-snapper.cpp index 059d99a19..d1991e75d 100644 --- a/src/guide-snapper.cpp +++ b/src/guide-snapper.cpp @@ -17,7 +17,7 @@ #include "sp-namedview.h" #include "sp-guide.h" -Inkscape::GuideSnapper::GuideSnapper(SPNamedView const *nv, Geom::Coord const d) : LineSnapper(nv, d) +Inkscape::GuideSnapper::GuideSnapper(SnapManager const *sm, Geom::Coord const d) : LineSnapper(sm, d) { } @@ -26,11 +26,11 @@ Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines(Geom::Poi { LineList s; - if ( NULL == _named_view || ThisSnapperMightSnap() == false) { + if ( NULL == _snapmanager->getNamedView() || ThisSnapperMightSnap() == false) { return s; } - for (GSList const *l = _named_view->guides; l != NULL; l = l->next) { + for (GSList const *l = _snapmanager->getNamedView()->guides; l != NULL; l = l->next) { SPGuide const *g = SP_GUIDE(l->data); s.push_back(std::make_pair(g->normal_to_line, g->point_on_line)); } @@ -43,7 +43,7 @@ Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines(Geom::Poi */ bool Inkscape::GuideSnapper::ThisSnapperMightSnap() const { - return _named_view == NULL ? false : (_snap_enabled && _snap_from != 0 && _named_view->showguides); + return _snapmanager->getNamedView() == NULL ? false : (_snap_enabled && _snap_from != 0 && _snapmanager->getNamedView()->showguides); } void Inkscape::GuideSnapper::_addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, Geom::Point const normal_to_line, Geom::Point const point_on_line) const |
