]> www.fi.muni.cz Git - evince.git/commitdiff
Make selection work in any direction
authorMarco Pesenti Gritti <marco@gnome.org>
Fri, 21 Jan 2005 10:52:48 +0000 (10:52 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Fri, 21 Jan 2005 10:52:48 +0000 (10:52 +0000)
2005-01-21  Marco Pesenti Gritti  <marco@gnome.org>

        * shell/ev-view.c: (ev_view_button_press_event),
        (ev_view_motion_notify_event):

        Make selection work in any direction

ChangeLog
shell/ev-view.c

index f05b54f90602ad5b0b6683fdfc2c38d5ae0b0e91..513a96e04d5415b045e13a351739dbef01b30151 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-21  Marco Pesenti Gritti  <marco@gnome.org>
+
+       * 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  <marco@gnome.org>
 
        * TODO:
index f2f879b8bb7261f94c805022ee20e802095a38ee..6997c5d36e5a5e2f7ff760315d08ef5ae3fe83ee 100644 (file)
@@ -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;