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.
This commit is contained in:
Timm Bäder 2020-01-04 08:54:58 +01:00
parent a3f14a3395
commit 7669e6e42e

View 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