From: Marco Pesenti Gritti Date: Fri, 21 Jan 2005 10:52:48 +0000 (+0000) Subject: Make selection work in any direction X-Git-Tag: EVINCE_0_1_1~18 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=922f0476fd7f6252fc40ea52e99292711c2900d2;p=evince.git Make selection work in any direction 2005-01-21 Marco Pesenti Gritti * shell/ev-view.c: (ev_view_button_press_event), (ev_view_motion_notify_event): Make selection work in any direction --- diff --git a/ChangeLog b/ChangeLog index f05b54f9..513a96e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-01-21 Marco Pesenti Gritti + + * shell/ev-view.c: (ev_view_button_press_event), + (ev_view_motion_notify_event): + + Make selection work in any direction + 2005-01-21 Marco Pesenti Gritti * TODO: diff --git a/shell/ev-view.c b/shell/ev-view.c index f2f879b8..6997c5d3 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -77,6 +77,7 @@ struct _EvView { gboolean pressed_button; gboolean has_selection; + GdkPoint selection_start; GdkRectangle selection; EvViewCursor cursor; @@ -529,10 +530,8 @@ ev_view_button_press_event (GtkWidget *widget, gtk_widget_queue_draw (widget); } - view->selection.x = event->x; - view->selection.y = event->y; - view->selection.width = 0; - view->selection.height = 0; + view->selection_start.x = event->x; + view->selection_start.y = event->y; break; } @@ -630,10 +629,10 @@ ev_view_motion_notify_event (GtkWidget *widget, if (view->pressed_button > 0) { view->has_selection = TRUE; - view->selection.x = MIN (view->selection.x, event->x); - view->selection.y = MIN (view->selection.y, event->y); - view->selection.width = ABS (view->selection.x - event->x) + 1; - view->selection.height = ABS (view->selection.y - event->y) + 1; + view->selection.x = MIN (view->selection_start.x, event->x); + view->selection.y = MIN (view->selection_start.y, event->y); + view->selection.width = ABS (view->selection_start.x - event->x) + 1; + view->selection.height = ABS (view->selection_start.y - event->y) + 1; } else if (view->document) { EvLink *link;