[gtk/wip/baedert/gl-rework: 2/2] transform: Properly compare scale transforms



commit 8cf0c39f40d48ca373e06a79b40ded6224abed88
Author: Timm Bäder <mail baedert org>
Date:   Sat Jan 4 08:54:58 2020 +0100

    transform: Properly compare scale transforms
    
    If the epsilon we use there is too much, we can run into rendering
    errors because the GPU will use the actual scale value.

 gsk/gsktransform.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gsk/gsktransform.c b/gsk/gsktransform.c
index 9db4e4b4e2..3f944db9ea 100644
--- a/gsk/gsktransform.c
+++ b/gsk/gsktransform.c
@@ -1077,9 +1077,9 @@ gsk_scale_transform_equal (GskTransform *first_transform,
   GskScaleTransform *first = (GskScaleTransform *) first_transform;
   GskScaleTransform *second = (GskScaleTransform *) second_transform;
 
-  return G_APPROX_VALUE (first->factor_x, second->factor_x, 0.01f) &&
-         G_APPROX_VALUE (first->factor_y, second->factor_y, 0.01f) &&
-         G_APPROX_VALUE (first->factor_z, second->factor_z, 0.01f);
+  return G_APPROX_VALUE (first->factor_x, second->factor_x, FLT_EPSILON) &&
+         G_APPROX_VALUE (first->factor_y, second->factor_y, FLT_EPSILON) &&
+         G_APPROX_VALUE (first->factor_z, second->factor_z, FLT_EPSILON);
 }
 
 static void


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