Code

add accessor for the waiting_cursor flag (sorry for the recompile)
[inkscape.git] / src / guide-snapper.cpp
index 059d99a198caaac3eccf2b6c842aaa04f8a7938b..54a4086a447c311b738530c10c2596a8747f380e 100644 (file)
@@ -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 *sm, Geom::Coord const d) : LineSnapper(sm, d)
 {
 
 }
@@ -26,13 +26,13 @@ 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)); 
+        s.push_back(std::make_pair(g->normal_to_line, g->point_on_line));
     }
 
     return s;
@@ -43,7 +43,11 @@ 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);
+       if (_snapmanager->getNamedView() == NULL) {
+               return false;
+       }
+
+       return (_snap_enabled && _snapmanager->snapprefs.getSnapToGuides() && _snapmanager->snapprefs.getSnapModeBBoxOrNodes() && _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