mirror of
https://gitlab.com/oeffi/oeffi.git
synced 2025-07-08 00:08:48 +00:00
Zoomer: Replace manual clipping of a value with Math.min().
This commit is contained in:
parent
0f9e241fe8
commit
07fc3718a6
1 changed files with 1 additions and 1 deletions
|
@ -47,7 +47,7 @@ public class Zoomer {
|
||||||
if (zoomStart != 0) {
|
if (zoomStart != 0) {
|
||||||
final float time = (float) (System.currentTimeMillis() - zoomStart) / DEFAULT_ZOOM_DURATION;
|
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)
|
if (time >= 1.0f)
|
||||||
zoomStart = 0;
|
zoomStart = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue