]> git.sur5r.net Git - glabels/commitdiff
Don't assume all events are button events!
authorJim Evins <evins@snaught.com>
Sat, 27 Apr 2002 03:47:15 +0000 (03:47 +0000)
committerJim Evins <evins@snaught.com>
Sat, 27 Apr 2002 03:47:15 +0000 (03:47 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@7 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels1/src/mini_preview.c

index 9b4f5ef6c2b26952f6434ec7cfdfc1a4bb381045..b5b434ee1e9a7c8ee9ecefd370d7410d48974afe 100644 (file)
@@ -362,13 +362,12 @@ canvas_event_cb (GnomeCanvas * canvas,
        gint i;
        gdouble x, y;
 
-       gnome_canvas_window_to_world (canvas,
-                                     event->button.x, event->button.y,
-                                     &x, &y);
-
        switch (event->type) {
 
        case GDK_BUTTON_PRESS:
+               gnome_canvas_window_to_world (canvas,
+                                             event->button.x, event->button.y,
+                                             &x, &y);
                switch (event->button.button) {
                case 1:
                        /* Get item at cursor and make sure
@@ -406,6 +405,9 @@ canvas_event_cb (GnomeCanvas * canvas,
                break;
 
        case GDK_BUTTON_RELEASE:
+               gnome_canvas_window_to_world (canvas,
+                                             event->button.x, event->button.y,
+                                             &x, &y);
                switch (event->button.button) {
                case 1:
                        /* Exit dragging mode */
@@ -419,6 +421,9 @@ canvas_event_cb (GnomeCanvas * canvas,
                break;
 
        case GDK_MOTION_NOTIFY:
+               gnome_canvas_window_to_world (canvas,
+                                             event->motion.x, event->motion.y,
+                                             &x, &y);
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        /* Get item at cursor and
                           make sure it's a label object ("i" is valid) */