[gtk/transform-fixes: 639/639] Use getters for translation and scaling components



commit cf9deb7cf555382de3f56f56ad75bc9dfd38390c
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Mar 22 13:54:29 2019 +0000

    Use getters for translation and scaling components
    
    Instead of accessing the matrix cells directly.

 gsk/gsktransform.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gsk/gsktransform.c b/gsk/gsktransform.c
index e67f7ce83c..40917be44c 100644
--- a/gsk/gsktransform.c
+++ b/gsk/gsktransform.c
@@ -310,15 +310,15 @@ gsk_matrix_transform_apply_affine (GskTransform *transform,
       break;
 
     case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
-      *out_dx += *out_scale_x * graphene_matrix_get_value (&self->matrix, 3, 0);
-      *out_dy += *out_scale_y * graphene_matrix_get_value (&self->matrix, 3, 1);
-      *out_scale_x *= graphene_matrix_get_value (&self->matrix, 0, 0);
-      *out_scale_y *= graphene_matrix_get_value (&self->matrix, 1, 1);
+      *out_dx += *out_scale_x * graphene_matrix_get_x_translation (&self->matrix);
+      *out_dy += *out_scale_y * graphene_matrix_get_y_translation (&self->matrix);
+      *out_scale_x *= graphene_matrix_get_x_scale (&self->matrix);
+      *out_scale_y *= graphene_matrix_get_y_scale (&self->matrix);
       break;
 
     case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
-      *out_dx += *out_scale_x * graphene_matrix_get_value (&self->matrix, 3, 0);
-      *out_dy += *out_scale_y * graphene_matrix_get_value (&self->matrix, 3, 1);
+      *out_dx += *out_scale_x * graphene_matrix_get_x_translation (&self->matrix);
+      *out_dy += *out_scale_y * graphene_matrix_get_y_translation (&self->matrix);
       break;
 
     case GSK_TRANSFORM_CATEGORY_IDENTITY:
@@ -345,8 +345,8 @@ gsk_matrix_transform_apply_translate (GskTransform *transform,
       break;
 
     case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
-      *out_dx += graphene_matrix_get_value (&self->matrix, 3, 0);
-      *out_dy += graphene_matrix_get_value (&self->matrix, 3, 1);
+      *out_dx += graphene_matrix_get_x_translation (&self->matrix);
+      *out_dy += graphene_matrix_get_y_translation (&self->matrix);
       break;
 
     case GSK_TRANSFORM_CATEGORY_IDENTITY:


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