[gtk/wip/baedert/gl-rework: 7/8] transform: Properly compare scale transforms
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/gl-rework: 7/8] transform: Properly compare scale transforms
- Date: Mon, 6 Jan 2020 13:55:04 +0000 (UTC)
commit 98b119c75baeab0ca7ebb8b63f003c2326354dfb
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]