Code

Filter effects dialog:
[inkscape.git] / src / rect-context.cpp
index 8482cd0424432841731556f86218f4f275051f48..c8f9bf0f101d0b1e2cc9e3b50a79bf49b5f3dc13 100644 (file)
@@ -330,7 +330,7 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
             NR::Point motion_dt(desktop->w2d(motion_w));
             
             SnapManager const &m = desktop->namedview->snap_manager;
-            motion_dt = m.freeSnap(Inkscape::Snapper::BBOX_POINT | Inkscape::Snapper::SNAP_POINT, motion_dt, NULL).getPoint();   
+            motion_dt = m.freeSnap(Inkscape::Snapper::BBOX_POINT | Inkscape::Snapper::SNAP_POINT, motion_dt, rc->item).getPoint();
             
             sp_rect_drag(*rc, motion_dt, event->motion.state);
             
@@ -400,6 +400,21 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
         case GDK_Escape:
             sp_desktop_selection(desktop)->clear();
             //TODO: make dragging escapable by Esc
+            break;
+
+        case GDK_space:
+            if (dragging) {
+                sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate),
+                                      event->button.time);
+                dragging = false;
+                if (!event_context->within_tolerance) {
+                    // we've been dragging, finish the rect
+                    sp_rect_finish(rc);
+                }
+                // do not return true, so that space would work switching to selector
+            }
+            break;
+
         default:
             break;
         }