diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2009-01-25 14:18:02 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2009-01-25 14:18:02 +0000 |
| commit | a96c86bc123dd55279face6372339b37c169a0d0 (patch) | |
| tree | 8562f5728710b6f9433519e8350168bb7f145035 /src | |
| parent | - The snap-delay mechanism should now be more robust. From now on, it must be... (diff) | |
| download | inkscape-a96c86bc123dd55279face6372339b37c169a0d0.tar.gz inkscape-a96c86bc123dd55279face6372339b37c169a0d0.zip | |
Display the snap source indicator only when snapping is enabled
(bzr r7173)
Diffstat (limited to 'src')
| -rw-r--r-- | src/display/snap-indicator.cpp | 18 | ||||
| -rw-r--r-- | src/seltrans.cpp | 10 | ||||
| -rw-r--r-- | src/snap.cpp | 2 |
3 files changed, 16 insertions, 14 deletions
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(); |
