diff options
| author | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-02-14 08:18:22 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-02-14 08:18:22 +0000 |
| commit | 611c78a2a2a89141435de1581b1a9b82780afe69 (patch) | |
| tree | 972487508d897595b5aa379b9c13e0c674f47c99 /src/rect-context.cpp | |
| parent | Slightly updated Russian translation (diff) | |
| download | inkscape-611c78a2a2a89141435de1581b1a9b82780afe69.tar.gz inkscape-611c78a2a2a89141435de1581b1a9b82780afe69.zip | |
Implementation of snap delay mechanism for guides
(bzr r9088)
Diffstat (limited to 'src/rect-context.cpp')
| -rw-r--r-- | src/rect-context.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/rect-context.cpp b/src/rect-context.cpp index a3c3ab0b5..7ae27c13d 100644 --- a/src/rect-context.cpp +++ b/src/rect-context.cpp @@ -122,15 +122,15 @@ static void sp_rect_context_init(SPRectContext *rect_context) static void sp_rect_context_finish(SPEventContext *ec) { SPRectContext *rc = SP_RECT_CONTEXT(ec); - SPDesktop *desktop = ec->desktop; + SPDesktop *desktop = ec->desktop; - sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), GDK_CURRENT_TIME); - sp_rect_finish(rc); + sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), GDK_CURRENT_TIME); + sp_rect_finish(rc); rc->sel_changed_connection.disconnect(); if (((SPEventContextClass *) parent_class)->finish) { - ((SPEventContextClass *) parent_class)->finish(ec); - } + ((SPEventContextClass *) parent_class)->finish(ec); + } } @@ -396,14 +396,14 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent break; case GDK_Escape: - if (dragging) { - dragging = false; - sp_event_context_discard_delayed_snap_event(event_context); - // if drawing, cancel, otherwise pass it up for deselecting - sp_rect_cancel(rc); - ret = TRUE; - } - break; + if (dragging) { + dragging = false; + sp_event_context_discard_delayed_snap_event(event_context); + // if drawing, cancel, otherwise pass it up for deselecting + sp_rect_cancel(rc); + ret = TRUE; + } + break; case GDK_space: if (dragging) { @@ -534,8 +534,8 @@ static void sp_rect_finish(SPRectContext *rc) if ( rc->item != NULL ) { SPRect *rect = SP_RECT(rc->item); if (rect->width.computed == 0 || rect->height.computed == 0) { - sp_rect_cancel(rc); // Don't allow the creating of zero sized rectangle, for example when the start and and point snap to the snap grid point - return; + sp_rect_cancel(rc); // Don't allow the creating of zero sized rectangle, for example when the start and and point snap to the snap grid point + return; } SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(rc); @@ -554,14 +554,14 @@ static void sp_rect_finish(SPRectContext *rc) static void sp_rect_cancel(SPRectContext *rc) { - SPDesktop *desktop = SP_EVENT_CONTEXT(rc)->desktop; + SPDesktop *desktop = SP_EVENT_CONTEXT(rc)->desktop; - sp_desktop_selection(desktop)->clear(); - sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), 0); + sp_desktop_selection(desktop)->clear(); + sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), 0); if (rc->item != NULL) { - SP_OBJECT(rc->item)->deleteObject(); - rc->item = NULL; + SP_OBJECT(rc->item)->deleteObject(); + rc->item = NULL; } rc->within_tolerance = false; |
