Code

Display the snap source indicator only when snapping is enabled
authordvlierop2 <dvlierop2@users.sourceforge.net>
Sun, 25 Jan 2009 14:18:02 +0000 (14:18 +0000)
committerdvlierop2 <dvlierop2@users.sourceforge.net>
Sun, 25 Jan 2009 14:18:02 +0000 (14:18 +0000)
src/display/snap-indicator.cpp
src/seltrans.cpp
src/snap.cpp

index c21bd3dbc8bad6b2992964525899a6cb3a370783..98358dbabbd63fdfc6b0fad8140094181916e13c 100644 (file)
@@ -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);
     }
index b1917edfd523393abfe150eea325634e1a0ca162..76cfbe225a4c824212843efe8e8027e8d7f2489e 100644 (file)
@@ -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));
+                       }
        }
     }
 
index 11ba077e449976e42031fd4112a347c9b5f8b621..7404ed12b8eaea62a60476e40fec1e3837a01f06 100644 (file)
@@ -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();