Code

set busy cursor and statusbar message while creating clones
[inkscape.git] / src / guide-snapper.cpp
index 473198af34d3fbfe9ebfb21e6fc3d31fc4e5d895..41e2cdb0708bc480366cda9317277bb9570ec661 100644 (file)
@@ -32,13 +32,7 @@ Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines(NR::Point
 
     for (GSList const *l = _named_view->guides; l != NULL; l = l->next) {
         SPGuide const *g = SP_GUIDE(l->data);
-
-        /* We assume here that guides are horizontal or vertical */
-        if (g->normal == component_vectors[NR::X]) {
-            s.push_back(std::make_pair(NR::X, g->position));
-        } else {
-            s.push_back(std::make_pair(NR::Y, g->position));
-        }
+        s.push_back(std::make_pair(g->normal_to_line, g->point_on_line)); 
     }
 
     return s;
@@ -49,12 +43,12 @@ Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines(NR::Point
  */
 bool Inkscape::GuideSnapper::ThisSnapperMightSnap() const
 {
-    return _named_view == NULL ? false : (_enabled && _snap_from != 0 && _named_view->showguides);
+    return _named_view == NULL ? false : (_snap_enabled && _snap_from != 0 && _named_view->showguides);
 }
 
 void Inkscape::GuideSnapper::_addSnappedLine(SnappedConstraints &sc, NR::Point const snapped_point, NR::Coord const snapped_distance, NR::Point const normal_to_line, NR::Point const point_on_line) const
 {
-    SnappedInfiniteLine dummy = SnappedInfiniteLine(snapped_point, snapped_distance, normal_to_line, point_on_line);
+    SnappedLine dummy = SnappedLine(snapped_point, snapped_distance, getSnapperTolerance(), getSnapperAlwaysSnap(), normal_to_line, point_on_line);
     sc.guide_lines.push_back(dummy);
 }