[gtk/wip/baedert/transforms5] gl renderer: Properly retrieve matrix scale



commit ce5b792d702b6c1a91353673ce5a10d8b1a449ae
Author: Timm Bäder <mail baedert org>
Date:   Sun Aug 12 17:42:58 2018 +0200

    gl renderer: Properly retrieve matrix scale
    
    So rotating offscreen nodes works.

 gsk/gl/gskglrenderops.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c
index 21223ee157..2868870f9a 100644
--- a/gsk/gl/gskglrenderops.c
+++ b/gsk/gl/gskglrenderops.c
@@ -14,9 +14,23 @@ float
 ops_get_scale (const RenderOpBuilder *builder)
 {
   const graphene_matrix_t *mv = &builder->current_modelview;
+  graphene_vec3_t col1;
+  graphene_vec3_t col2;
 
-  return MAX (graphene_matrix_get_x_scale (mv),
-              graphene_matrix_get_y_scale (mv));
+  /* TODO: We should probably split this up into two values... */
+
+  graphene_vec3_init (&col1,
+                      graphene_matrix_get_value (mv, 0, 0),
+                      graphene_matrix_get_value (mv, 1, 0),
+                      graphene_matrix_get_value (mv, 2, 0));
+
+  graphene_vec3_init (&col2,
+                      graphene_matrix_get_value (mv, 0, 1),
+                      graphene_matrix_get_value (mv, 1, 1),
+                      graphene_matrix_get_value (mv, 2, 1));
+
+  return MAX (graphene_vec3_length (&col1),
+              graphene_vec3_length (&col2));
 }
 
 void


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