diff options
author | Timm Bäder <mail@baedert.org> | 2017-07-22 06:52:08 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2017-07-22 06:52:46 +0200 |
commit | 5afbde2632d1fe5e42bbce23b0ec0e329a8700ff (patch) | |
tree | f2568ec116616ac4f6c3de4276c0af7b25a8ff23 /gtk/gtkflowbox.c | |
parent | b838cc0d65cb21e2a7bd6eb8310375530e3b3f99 (diff) | |
download | gtk+-5afbde2632d1fe5e42bbce23b0ec0e329a8700ff.tar.gz |
flowbox: Fix get_child_at_pos
Diffstat (limited to 'gtk/gtkflowbox.c')
-rw-r--r-- | gtk/gtkflowbox.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index 6a26d3570c..dde07b7d84 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -3991,9 +3991,6 @@ gtk_flow_box_get_child_at_pos (GtkFlowBox *box, GtkWidget *child; GSequenceIter *iter; GtkAllocation allocation; - GtkAllocation box_allocation; - - gtk_widget_get_allocation (GTK_WIDGET (box), &box_allocation); for (iter = g_sequence_get_begin_iter (BOX_PRIV (box)->children); !g_sequence_iter_is_end (iter); @@ -4004,10 +4001,7 @@ gtk_flow_box_get_child_at_pos (GtkFlowBox *box, continue; gtk_widget_get_allocation (child, &allocation); - allocation.x -= box_allocation.x; - allocation.y -= box_allocation.y; - if (x >= allocation.x && x < (allocation.x + allocation.width) && - y >= allocation.y && y < (allocation.y + allocation.height)) + if (gdk_rectangle_contains_point (&allocation, x, y)) return GTK_FLOW_BOX_CHILD (child); } |