From 9aca045129e79c6dc25f0f485186f20704a14ce8 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 12 May 2013 12:22:42 +0200 Subject: Fix for Bug #683561 (Can't select text using click - [SHIFT+click]). Fixed bugs: - https://launchpad.net/bugs/683561 (bzr r12327) --- src/text-context.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/text-context.cpp') diff --git a/src/text-context.cpp b/src/text-context.cpp index ae2d65836..862c50737 100644 --- a/src/text-context.cpp +++ b/src/text-context.cpp @@ -307,6 +307,7 @@ static gint sp_text_context_item_handler(SPEventContext *event_context, SPItem * gint ret = FALSE; sp_text_context_validate_cursor_iterators(tc); + Inkscape::Text::Layout::iterator old_start = tc->text_sel_start; switch (event->type) { case GDK_BUTTON_PRESS: @@ -319,7 +320,12 @@ static gint sp_text_context_item_handler(SPEventContext *event_context, SPItem * // find out click point in document coordinates Geom::Point p = desktop->w2d(Geom::Point(event->button.x, event->button.y)); // set the cursor closest to that point - tc->text_sel_start = tc->text_sel_end = sp_te_get_position_by_coords(tc->text, p); + if (event->button.state & GDK_SHIFT_MASK) { + tc->text_sel_start = old_start; + tc->text_sel_end = sp_te_get_position_by_coords(tc->text, p); + } else { + tc->text_sel_start = tc->text_sel_end = sp_te_get_position_by_coords(tc->text, p); + } // update display sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); -- cgit v1.2.3