Code

verbify esc to deselect; enable esc and ctrl-z to cancel drawing in calligraphic
[inkscape.git] / src / draw-context.cpp
index 6263880a4ded0f79151a13b94dc0a826e48c8bac..9390834d133041e3aef00e4f151211b8de40a861 100644 (file)
@@ -217,22 +217,6 @@ sp_draw_context_root_handler(SPEventContext *ec, GdkEvent *event)
     switch (event->type) {
         case GDK_KEY_PRESS:
             switch (get_group0_keyval (&event->key)) {
-                case GDK_Escape:
-                    sp_desktop_selection(desktop)->clear();
-                    ret = TRUE;
-                    break;
-                case GDK_Tab: // Tab - cycle selection forward
-                    if (!(MOD__CTRL_ONLY || (MOD__CTRL && MOD__SHIFT))) {
-                        sp_selection_item_next();
-                        ret = TRUE;
-                    }
-                    break;
-                case GDK_ISO_Left_Tab: // Shift Tab - cycle selection backward
-                    if (!(MOD__CTRL_ONLY || (MOD__CTRL && MOD__SHIFT))) {
-                        sp_selection_item_prev();
-                        ret = TRUE;
-                    }
-                    break;
                 case GDK_Up:
                 case GDK_Down:
                 case GDK_KP_Up:
@@ -301,7 +285,7 @@ spdc_attach_selection(SPDrawContext *dc, Inkscape::Selection *sel)
         SPCurve *norm = sp_shape_get_curve(SP_SHAPE(item));
         sp_curve_transform(norm, sp_item_i2d_affine(dc->white_item));
         g_return_if_fail( norm != NULL );
-        dc->white_curves = sp_curve_split(norm);
+        dc->white_curves = g_slist_reverse(sp_curve_split(norm));
         sp_curve_unref(norm);
         /* Anchor list */
         for (GSList *l = dc->white_curves; l != NULL; l = l->next) {
@@ -530,6 +514,7 @@ spdc_flush_white(SPDrawContext *dc, SPCurve *gc)
 
     SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(dc);
     SPDocument *doc = sp_desktop_document(desktop);
+    Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
 
     if ( c && !sp_curve_empty(c) ) {
         /* We actually have something to write */
@@ -538,7 +523,7 @@ spdc_flush_white(SPDrawContext *dc, SPCurve *gc)
         if (dc->white_item) {
             repr = SP_OBJECT_REPR(dc->white_item);
         } else {
-            repr = sp_repr_new("svg:path");
+            repr = xml_doc->createElement("svg:path");
             /* Set style */
             sp_desktop_apply_style_tool(desktop, repr, tool_name(dc), false);
         }
@@ -557,7 +542,8 @@ spdc_flush_white(SPDrawContext *dc, SPCurve *gc)
             item->updateRepr();
         }
 
-        sp_document_done(doc);
+        sp_document_done(doc, SP_IS_PEN_CONTEXT(dc)? SP_VERB_CONTEXT_PEN : SP_VERB_CONTEXT_PENCIL, 
+                         _("Draw path"));
     }
 
     sp_curve_unref(c);