Code

Diederik's patch for crash bug 441255
authorbuliabyak <buliabyak@users.sourceforge.net>
Sun, 4 Oct 2009 15:20:53 +0000 (15:20 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sun, 4 Oct 2009 15:20:53 +0000 (15:20 +0000)
src/seltrans.cpp

index 1087ec7b56da9064a9dde913e800bd435b2ddb27..708ee4b09a1d15e4dcdc2ca41bba1bfc2ef27c85 100644 (file)
@@ -408,8 +408,9 @@ void Inkscape::SelTrans::grab(Geom::Point const &p, gdouble x, gdouble y, bool s
         // Optionally, show the snap source
         if (!(_state == STATE_ROTATE && x != 0.5 && y != 0.5)) { // but not when we're dragging 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((_snap_points.size() + _bbox_points.size() + _bbox_points_for_translating.size()) == 1);
-            if (m.snapprefs.getSnapEnabledGlobally()) {
+            if ((_snap_points.size() + _bbox_points.size() + _bbox_points_for_translating.size()) > 1) {
+                g_warning("too many snap sources to display, please fix this");
+            } else if (m.snapprefs.getSnapEnabledGlobally()) {
                 if (_bbox_points.size() == 1) {
                     _desktop->snapindicator->set_new_snapsource(_bbox_points.at(0));
                 } else if (_bbox_points_for_translating.size() == 1) {