From be7ef9f963948344a8417467e953fe0761c14fcb Mon Sep 17 00:00:00 2001 From: Abraham Wolk Date: Mon, 10 Jul 2023 14:13:42 +0200 Subject: [PATCH] Add condition that the selected step is greater or equal to the computer minimum distance when selecting a step size. --- .../java/org/csstudio/javafx/rtplot/internal/LinearTicks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/internal/LinearTicks.java b/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/internal/LinearTicks.java index 54852e8357..2b72390009 100644 --- a/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/internal/LinearTicks.java +++ b/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/internal/LinearTicks.java @@ -272,7 +272,7 @@ public static double selectNiceStep(final double distance) final double order_of_magnitude = Math.pow(10, Math.floor(log)); final double step = distance / order_of_magnitude; for (int i=0; i= NICE_THRESHOLDS[i]) + if (step >= NICE_THRESHOLDS[i] && NICE_STEPS[i] * order_of_magnitude >= distance) return NICE_STEPS[i] * order_of_magnitude; return step * order_of_magnitude; }