[librsvg: 13/15] Increase the epsilon for Rect::approx_eq()
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 13/15] Increase the epsilon for Rect::approx_eq()
- Date: Tue, 10 May 2022 02:13:50 +0000 (UTC)
commit b4170e31ab6eb9aecea5a779fd4aea4a310510c2
Author: Federico Mena Quintero <federico gnome org>
Date: Mon May 9 20:06:08 2022 -0500
Increase the epsilon for Rect::approx_eq()
The default from the float-cmp crate is
F64Margin {
epsilon: f64::EPSILON,
ulps: 4
}
but it looks like we need a bigger epsilon...
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/697>
src/rect.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/rect.rs b/src/rect.rs
index 7de0cd4cb..8ec4f1ed2 100644
--- a/src/rect.rs
+++ b/src/rect.rs
@@ -159,10 +159,10 @@ mod rect {
pub fn approx_eq(&self, other: &Self) -> bool {
// FIXME: this is super fishy; shouldn't we be using 2x the epsilon against the width/height
// instead of the raw coordinates?
- approx_eq!(f64, self.x0, other.x0)
- && approx_eq!(f64, self.y0, other.y0)
- && approx_eq!(f64, self.x1, other.x1)
- && approx_eq!(f64, self.y1, other.y1)
+ approx_eq!(f64, self.x0, other.x0, epsilon = 0.0001)
+ && approx_eq!(f64, self.y0, other.y0, epsilon = 0.0001)
+ && approx_eq!(f64, self.x1, other.x1, epsilon = 0.0001)
+ && approx_eq!(f64, self.y1, other.y1, epsilon = 0.00012)
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]