From e054900210bd868ed5241f37a6c7220ce13f577f Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sat, 27 Apr 2002 03:47:15 +0000 Subject: [PATCH] Don't assume all events are button events! git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@7 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels1/src/mini_preview.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/glabels1/src/mini_preview.c b/glabels1/src/mini_preview.c index 9b4f5ef6..b5b434ee 100644 --- a/glabels1/src/mini_preview.c +++ b/glabels1/src/mini_preview.c @@ -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) */ -- 2.39.5