From 47233ea7014e34adca8a5c1d2323a57e9de1c7fa Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 3 Sep 2023 08:31:24 +0200 Subject: FloatUtil.isEqual(..): Rename raw {isEqual->isEqualRaw}(a,b) varianr w/o EPSILON; Add isEqual(a,b) w/ default EPSILON; Use it where applicable Also add isEqual2(a,b) w/o corner cases (NaN, Inf) used for comparison in Graph Outline, OutlineShape and later GraphUI Shape. --- src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java | 2 +- src/jogl/classes/com/jogamp/graph/geom/Outline.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/com/jogamp/graph') diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java index 1a1bd94dd..644f428cd 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java +++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java @@ -1060,7 +1060,7 @@ public final class OutlineShape implements Comparable { public final int compareTo(final OutlineShape other) { final float thisSize = getBounds().getSize(); final float otherSize = other.getBounds().getSize(); - if( FloatUtil.isEqual(thisSize, otherSize, FloatUtil.EPSILON) ) { + if( FloatUtil.isEqual2(thisSize, otherSize) ) { return 0; } else if( thisSize < otherSize ){ return -1; diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java index a0999baa1..654bd2636 100644 --- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java +++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java @@ -318,7 +318,7 @@ public class Outline implements Comparable { public final int compareTo(final Outline other) { final float thisSize = getBounds().getSize(); final float otherSize = other.getBounds().getSize(); - if( FloatUtil.isEqual(thisSize, otherSize, FloatUtil.EPSILON) ) { + if( FloatUtil.isEqual2(thisSize, otherSize) ) { return 0; } else if(thisSize < otherSize){ return -1; -- cgit v1.2.3