Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90cc9d74 authored by Marcus Danielsson's avatar Marcus Danielsson Committed by Vladislav Koldobskiy
Browse files

Round off when calculate next step in Seekbar

When the positions for the new step is calculated in
a Seekbar, a rounding error can appear.
This is fixed by round off before casting.

Change-Id: Ie2cf201ef670ccc2297e9bc4c7f415a826e44a41
parent debb17a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -292,7 +292,7 @@ public abstract class AbsSeekBar extends ProgressBar {
        // The extra space for the thumb to move on the track
        available += mThumbOffset * 2;

        int thumbPos = (int) (scale * available);
        int thumbPos = (int) (scale * available + 0.5f);

        int topBound, bottomBound;
        if (gap == Integer.MIN_VALUE) {