[gtk/wip/baedert/for-master: 748/748] widget: Use gsk_transform_transform_point() in gtk_widget_pick()
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 748/748] widget: Use gsk_transform_transform_point() in gtk_widget_pick()
- Date: Fri, 24 Jan 2020 05:22:11 +0000 (UTC)
commit 8e41fa2778900422d1d094bbc5bf659ac2409bf3
Author: Timm Bäder <mail baedert org>
Date: Fri Jan 24 06:18:03 2020 +0100
widget: Use gsk_transform_transform_point() in gtk_widget_pick()
This also covers the 2D_AFFINE case.
gtk/gtkwidget.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f3224d2cb6..283c5163e3 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10502,12 +10502,15 @@ gtk_widget_do_pick (GtkWidget *widget,
{
transform = NULL;
}
- if (gsk_transform_get_category (transform) >= GSK_TRANSFORM_CATEGORY_2D_TRANSLATE)
+
+ if (gsk_transform_get_category (transform) >= GSK_TRANSFORM_CATEGORY_2D_AFFINE)
{
- float dx, dy;
+ graphene_point_t transformed_p;
- gsk_transform_to_translate (transform, &dx, &dy);
- graphene_point3d_init (&res, x + dx, y + dy, 0.);
+ gsk_transform_transform_point (transform,
+ &(graphene_point_t) { x, y },
+ &transformed_p);
+ graphene_point3d_init (&res, transformed_p.x, transformed_p.y, 0.);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]