diff --git a/src/snap.cpp b/src/snap.cpp
index 11ba077e449976e42031fd4112a347c9b5f8b621..548741455704b51b510b052b2d9df4a608d0dd9f 100644 (file)
--- a/src/snap.cpp
+++ b/src/snap.cpp
SnapperList s;
//FIXME: this code should actually do this: add new grid snappers that are active for this desktop. now it just adds all gridsnappers
- SPDesktop* desktop = SP_ACTIVE_DESKTOP;
- if (desktop && desktop->gridsEnabled()) {
+ if (_desktop && _desktop->gridsEnabled() && snapprefs.getSnapToGrids()) {
for ( GSList const *l = _named_view->grids; l != NULL; l = l->next) {
Inkscape::CanvasGrid *grid = (Inkscape::CanvasGrid*) l->data;
s.push_back(grid->snapper);
return t;
//FIXME: this code should actually do this: add new grid snappers that are active for this desktop. now it just adds all gridsnappers
- SPDesktop* desktop = SP_ACTIVE_DESKTOP;
- if (desktop && desktop->gridsEnabled()) {
+ if (_desktop && _desktop->gridsEnabled()) {
bool success = false;
Geom::Point nearest_multiple;
Geom::Coord nearest_distance = NR_HUGE;
// this, so when using multiple grids one can get unexpected results
// Cannot use getGridSnappers() because we need both the grids AND their snappers
- // Therefor we iterate through all grids manually
+ // Therefore we iterate through all grids manually
for (GSList const *l = _named_view->grids; l != NULL; l = l->next) {
Inkscape::CanvasGrid *grid = (Inkscape::CanvasGrid*) l->data;
const Inkscape::Snapper* snapper = grid->snapper;
@@ -787,7 +785,7 @@ Inkscape::SnappedPoint SnapManager::findBestSnap(Geom::Point const &p, SnappedCo
if (snapprefs.getSnapIntersectionCS()) {
// search for the closest snapped intersection of curves
Inkscape::SnappedPoint closestCurvesIntersection;
- if (getClosestIntersectionCS(sc.curves, p, closestCurvesIntersection)) {
+ if (getClosestIntersectionCS(sc.curves, p, closestCurvesIntersection, _desktop->dt2doc())) {
sp_list.push_back(closestCurvesIntersection);
}
}
@@ -939,7 +937,7 @@ void SnapManager::_displaySnapsource(Inkscape::SnapPreferences::PointType point_
if (prefs->getBool("/options/snapclosestonly/value")) {
bool p_is_a_node = point_type & Inkscape::SnapPreferences::SNAPPOINT_NODE;
bool p_is_a_bbox = point_type & Inkscape::SnapPreferences::SNAPPOINT_BBOX;
- if ((p_is_a_node && snapprefs.getSnapModeNode()) || (p_is_a_bbox && snapprefs.getSnapModeBBox())) {
+ if (snapprefs.getSnapEnabledGlobally() && ((p_is_a_node && snapprefs.getSnapModeNode()) || (p_is_a_bbox && snapprefs.getSnapModeBBox()))) {
_desktop->snapindicator->set_new_snapsource(p);
} else {
_desktop->snapindicator->remove_snapsource();