[gtk] widget: Compute child point directly when picking
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] widget: Compute child point directly when picking
- Date: Tue, 19 Feb 2019 18:24:44 +0000 (UTC)
commit e922ec183964fdeeffe498fb37cee1d789bab568
Author: Timm Bäder <mail baedert org>
Date: Tue Feb 19 08:51:51 2019 +0100
widget: Compute child point directly when picking
gtk/gtkwidget.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f6a31d07a3..6a62f5b3e4 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -819,12 +819,16 @@ gtk_widget_real_pick (GtkWidget *widget,
child;
child = _gtk_widget_get_prev_sibling (child))
{
+ GtkWidgetPrivate *priv = gtk_widget_get_instance_private (child);
+ graphene_matrix_t inv;
GtkWidget *picked;
- double dx, dy;
+ graphene_point_t p;
- gtk_widget_translate_coordinatesf (widget, child, x, y, &dx, &dy);
+ graphene_matrix_inverse (&priv->transform, &inv);
+ graphene_point_init (&p, x, y);
+ graphene_matrix_transform_point (&inv, &p, &p);
- picked = gtk_widget_pick (child, dx, dy);
+ picked = gtk_widget_pick (child, p.x, p.y);
if (picked)
return picked;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]