Code

- Don't display the snap-source-indicator when we're about to rotate using the select...
authordvlierop2 <dvlierop2@users.sourceforge.net>
Thu, 2 Apr 2009 20:21:13 +0000 (20:21 +0000)
committerdvlierop2 <dvlierop2@users.sourceforge.net>
Thu, 2 Apr 2009 20:21:13 +0000 (20:21 +0000)
- Use a smaller snap-source-indicator, which is visually more appealing

src/display/snap-indicator.cpp
src/seltrans.cpp

index 901bee6adcf769278acec9f24c79a043d921d173..240fe9545184cb6c5b18f019dbb1747f6cde4035 100644 (file)
@@ -271,7 +271,7 @@ SnapIndicator::set_new_snapsource(std::pair<Geom::Point, int> const p)
         SPCanvasItem * canvasitem = sp_canvas_item_new( sp_desktop_tempgroup (_desktop),
                                                         SP_TYPE_CTRL,
                                                         "anchor", GTK_ANCHOR_CENTER,
-                                                        "size", 10.0,
+                                                        "size", 6.0,
                                                         "stroked", TRUE,
                                                         "stroke_color", 0xf000f0ff,
                                                         "mode", SP_KNOT_MODE_XOR,
index e6c53acfeb0163ea88a81fc671973deb55fa3a8a..1ee7faff8753e0b412717b3146821674f5eb657d 100644 (file)
@@ -357,13 +357,17 @@ 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 (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));
+
+       // Optionally, show the snap source
+       if (!(_state == STATE_ROTATE && x != 0.5 && y != 0.5)) { // but not when we're draging a rotation handle, because that won't snap
+                       // 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 (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));
+                               }
                        }
        }
     }