From: dvlierop2 Date: Sun, 25 Jan 2009 14:18:02 +0000 (+0000) Subject: Display the snap source indicator only when snapping is enabled X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1f203f525100bbdd7d964f8b1c004929418f0b5f;p=inkscape.git Display the snap source indicator only when snapping is enabled --- diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp index c21bd3dbc..98358dbab 100644 --- a/src/display/snap-indicator.cpp +++ b/src/display/snap-indicator.cpp @@ -40,15 +40,15 @@ void SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const p) { remove_snaptarget(); - + g_assert(_desktop != NULL); - + /* Commented out for now, because this might hide any snapping bug! if (!p.getSnapped()) { return; // If we haven't snapped, then it is of no use to draw a snapindicator } */ - + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool value = prefs->getBool("/options/snapindicator/value", true); @@ -110,12 +110,12 @@ void SnapIndicator::set_new_snapsource(Geom::Point const p) { remove_snapsource(); - + g_assert(_desktop != NULL); - + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool value = prefs->getBool("/options/snapindicator/value", true); - + if (value) { SPCanvasItem * canvasitem = sp_canvas_item_new( sp_desktop_tempgroup (_desktop), SP_TYPE_CTRL, @@ -124,9 +124,9 @@ SnapIndicator::set_new_snapsource(Geom::Point const p) "stroked", TRUE, "stroke_color", 0xf000f0ff, "mode", SP_KNOT_MODE_XOR, - "shape", SP_KNOT_SHAPE_DIAMOND, - NULL ); - + "shape", SP_KNOT_SHAPE_CIRCLE, + NULL ); + SP_CTRL(canvasitem)->moveto(p); _snapsource = _desktop->add_temporary_canvasitem(canvasitem, 1000); } diff --git a/src/seltrans.cpp b/src/seltrans.cpp index b1917edfd..76cfbe225 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -359,10 +359,12 @@ void Inkscape::SelTrans::grab(Geom::Point const &p, gdouble x, gdouble y, bool s // Now either _bbox_points or _snap_points has a single element, the other one has zero..... or both have zero elements g_assert((_bbox_points.size() + _snap_points.size()) < 2); - if (_bbox_points.size() == 1) { - _desktop->snapindicator->set_new_snapsource(_bbox_points.at(0)); - } else if (_snap_points.size() == 1){ - _desktop->snapindicator->set_new_snapsource(_snap_points.at(0)); + if (m.snapprefs.getSnapEnabledGlobally()) { + if (_bbox_points.size() == 1) { + _desktop->snapindicator->set_new_snapsource(_bbox_points.at(0)); + } else if (_snap_points.size() == 1){ + _desktop->snapindicator->set_new_snapsource(_snap_points.at(0)); + } } } diff --git a/src/snap.cpp b/src/snap.cpp index 11ba077e4..7404ed12b 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -939,7 +939,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();