From 07fc3718a61b43828be50ec1ab492d45a4cd6d6c Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Thu, 21 Jan 2021 00:15:03 +0100 Subject: [PATCH] Zoomer: Replace manual clipping of a value with Math.min(). --- oeffi/src/de/schildbach/oeffi/plans/Zoomer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oeffi/src/de/schildbach/oeffi/plans/Zoomer.java b/oeffi/src/de/schildbach/oeffi/plans/Zoomer.java index 33ad59d..61c9751 100644 --- a/oeffi/src/de/schildbach/oeffi/plans/Zoomer.java +++ b/oeffi/src/de/schildbach/oeffi/plans/Zoomer.java @@ -47,7 +47,7 @@ public class Zoomer { if (zoomStart != 0) { final float time = (float) (System.currentTimeMillis() - zoomStart) / DEFAULT_ZOOM_DURATION; - currentValue = interpolator.getInterpolation(time > 1.0f ? 1.0f : time) * zoomSpan + zoomFrom; + currentValue = interpolator.getInterpolation(Math.min(time, 1.0f)) * zoomSpan + zoomFrom; if (time >= 1.0f) zoomStart = 0;