transform: Properly compare scale transforms
authorTimm Bäder <mail@baedert.org>
Sat, 4 Jan 2020 07:54:58 +0000 (08:54 +0100)
committerTimm Bäder <mail@baedert.org>
Tue, 7 Jan 2020 16:27:19 +0000 (17:27 +0100)
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

index 9db4e4b4e24f8f7f186cc6f64cf1fef9fca26f1e..3f944db9ea31b24ad21c57c9d5bd971794d7e734 100644 (file)
@@ -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