diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-04-01 06:29:16 +0000 |
|---|---|---|
| committer | John Smith <removethis.john.q.public@bigmail.com> | 2012-04-01 06:29:16 +0000 |
| commit | a214939f48b7ce9c7aa22bcfc7261453c0c98d4a (patch) | |
| tree | e8251352425b993f5883edd48ae0d97a47d2c8fa /src/gradient-context.cpp | |
| parent | Fix for 627728 : Make newly added gradient stop active (diff) | |
| download | inkscape-a214939f48b7ce9c7aa22bcfc7261453c0c98d4a.tar.gz inkscape-a214939f48b7ce9c7aa22bcfc7261453c0c98d4a.zip | |
Fix for 179830 : gradient tool focus problems with overlapping objects
(bzr r11136)
Diffstat (limited to 'src/gradient-context.cpp')
| -rw-r--r-- | src/gradient-context.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/gradient-context.cpp b/src/gradient-context.cpp index 110ae0b8b..9d86619db 100644 --- a/src/gradient-context.cpp +++ b/src/gradient-context.cpp @@ -645,17 +645,17 @@ sp_gradient_context_root_handler(SPEventContext *event_context, GdkEvent *event) case GDK_BUTTON_RELEASE: event_context->xp = event_context->yp = 0; if ( event->button.button == 1 && !event_context->space_panning ) { - if ( (event->button.state & GDK_CONTROL_MASK) && (event->button.state & GDK_MOD1_MASK ) ) { - bool over_line = false; - SPCtrlLine *line = NULL; - if (drag->lines) { - for (GSList *l = drag->lines; (l != NULL) && (!over_line); l = l->next) { - line = (SPCtrlLine*) l->data; - over_line = sp_gradient_context_is_over_line (rc, (SPItem*) line, Geom::Point(event->motion.x, event->motion.y)); - if (over_line) - break; - } + bool over_line = false; + SPCtrlLine *line = NULL; + if (drag->lines) { + for (GSList *l = drag->lines; (l != NULL) && (!over_line); l = l->next) { + line = (SPCtrlLine*) l->data; + over_line = sp_gradient_context_is_over_line (rc, (SPItem*) line, Geom::Point(event->motion.x, event->motion.y)); + if (over_line) + break; } + } + if ( (event->button.state & GDK_CONTROL_MASK) && (event->button.state & GDK_MOD1_MASK ) ) { if (over_line && line) { sp_gradient_context_add_stop_near_point(rc, line->item, rc->mousepoint_doc, 0); ret = TRUE; @@ -682,11 +682,17 @@ sp_gradient_context_root_handler(SPEventContext *event_context, GdkEvent *event) } } else if (event_context->item_to_select) { - // no dragging, select clicked item if any - if (event->button.state & GDK_SHIFT_MASK) { - selection->toggle(event_context->item_to_select); - } else { - selection->set(event_context->item_to_select); + if (over_line && line) { + // Clicked on an existing gradient line, dont change selection. This stops + // possible change in selection during a double click with overlapping objects + } + else { + // no dragging, select clicked item if any + if (event->button.state & GDK_SHIFT_MASK) { + selection->toggle(event_context->item_to_select); + } else { + selection->set(event_context->item_to_select); + } } } else { // click in an empty space; do the same as Esc |
