diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-03-28 15:03:33 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-03-28 15:03:33 -0400 |
commit | 7916b95bc59d4cf93bdbc68ba13e241b9a8e0a36 (patch) | |
tree | 1ec973e55fc89fd6ba3cd9cc430e67b5d1affbe8 /gtk/gtkgesture.c | |
parent | 7b135c96e4d269384000fd3bf81f96333e95b3e6 (diff) | |
download | gtk+-7916b95bc59d4cf93bdbc68ba13e241b9a8e0a36.tar.gz |
gesture: Fix gtk_gesture_get_bounding_box
When we stopped translating event coordinates in-place,
this function inadvertently started returning surface-relative
bounding boxes instead of widget-relative ones, as expected.
Fix this by using the widget-relative coordinates that we
already store.
Diffstat (limited to 'gtk/gtkgesture.c')
-rw-r--r-- | gtk/gtkgesture.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c index 633c1fa3e7..8ef4440b58 100644 --- a/gtk/gtkgesture.c +++ b/gtk/gtkgesture.c @@ -1293,8 +1293,6 @@ gtk_gesture_get_bounding_box (GtkGesture *gesture, while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &data)) { - gdouble x, y; - if (data->state == GTK_EVENT_SEQUENCE_DENIED) continue; @@ -1304,12 +1302,11 @@ gtk_gesture_get_bounding_box (GtkGesture *gesture, event_type == GDK_BUTTON_RELEASE) continue; - gdk_event_get_position (data->event, &x, &y); n_points++; - x1 = MIN (x1, x); - y1 = MIN (y1, y); - x2 = MAX (x2, x); - y2 = MAX (y2, y); + x1 = MIN (x1, data->widget_x); + y1 = MIN (y1, data->widget_y); + x2 = MAX (x2, data->widget_x); + y2 = MAX (y2, data->widget_y); } if (n_points == 0) |