[gtk/projective-transform: 2/2] Replace uses of graphene_matrix_transform_




commit a2cba3c09890ddf70805937c585b49f2c4bff30f
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Sep 1 08:54:01 2020 -0400

    Replace uses of graphene_matrix_transform_
    
    Replace our uses of graphene_matrix_transform_point,
    _point3d and _bounds by our own versions that handle
    projective transforms correctly.
    
    This fixes render node bounds being incorrect for widgets
    involving projective transforms (e.g. testrevealer swing
    transformations), and also fixes picking on such widgets.

 gsk/gsktransform.c |  4 ++--
 gtk/gtkwidget.c    | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gsk/gsktransform.c b/gsk/gsktransform.c
index 528b115865..1b3384da33 100644
--- a/gsk/gsktransform.c
+++ b/gsk/gsktransform.c
@@ -1822,7 +1822,7 @@ gsk_transform_transform_bounds (GskTransform          *self,
         graphene_matrix_t mat;
 
         gsk_transform_to_matrix (self, &mat);
-        graphene_matrix_transform_bounds (&mat, rect, out_rect);
+        gsk_transform_bounds (&mat, rect, out_rect);
       }
       break;
     }
@@ -1878,7 +1878,7 @@ gsk_transform_transform_point (GskTransform           *self,
         graphene_matrix_t mat;
 
         gsk_transform_to_matrix (self, &mat);
-        graphene_matrix_transform_point (&mat, point, out_point);
+        gsk_transform_point (&mat, point, out_point);
       }
       break;
     }
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index e8106fca84..d8b2806a22 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4050,7 +4050,7 @@ gtk_widget_compute_point (GtkWidget              *widget,
       return FALSE;
     }
 
-  graphene_matrix_transform_point (&transform, point, out_point);
+  gsk_transform_point (&transform, point, out_point);
 
   return TRUE;
 }
@@ -9370,8 +9370,8 @@ gtk_widget_do_pick (GtkWidget    *widget,
               gsk_transform_unref (transform);
               graphene_point3d_init (&p0, x, y, 0);
               graphene_point3d_init (&p1, x, y, 1);
-              graphene_matrix_transform_point3d (&inv, &p0, &p0);
-              graphene_matrix_transform_point3d (&inv, &p1, &p1);
+              gsk_transform_point3d (&inv, &p0, &p0);
+              gsk_transform_point3d (&inv, &p1, &p1);
               if (fabs (p0.z - p1.z) < 1.f / 4096)
                 continue;
 
@@ -9547,9 +9547,9 @@ gtk_widget_compute_bounds (GtkWidget       *widget,
     }
 
   gtk_css_boxes_init (&boxes, widget);
-  graphene_matrix_transform_bounds (&transform,
-                                    gtk_css_boxes_get_border_rect (&boxes),
-                                    out_bounds);
+  gsk_transform_bounds (&transform,
+                        gtk_css_boxes_get_border_rect (&boxes),
+                        out_bounds);
 
   return TRUE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]