mirror of https://github.com/espruino/BangleApps
parent
b26d341609
commit
bf30b35ac0
|
@ -188,15 +188,16 @@ function drawProgressBar() {
|
||||||
let y2 = y1 + TOKEN_HEIGHT - 1;
|
let y2 = y1 + TOKEN_HEIGHT - 1;
|
||||||
if (y2 >= AR.y && y1 <= AR.y2) {
|
if (y2 >= AR.y && y1 <= AR.y2) {
|
||||||
// token visible
|
// token visible
|
||||||
if ((y2 - 3) <= AR.y2)
|
y1 = y2 - 3;
|
||||||
|
if (y1 <= AR.y2)
|
||||||
{
|
{
|
||||||
// progress bar visible
|
// progress bar visible
|
||||||
y2 = Math.min(y2, AR.y2);
|
y2 = Math.min(y2, AR.y2);
|
||||||
let xr = Math.floor(AR.w * rem / tokens[id].period) + AR.x;
|
let xr = Math.floor(AR.w * rem / tokens[id].period) + AR.x;
|
||||||
g.setColor(g.theme.fgH)
|
g.setColor(g.theme.fgH)
|
||||||
.setBgColor(g.theme.bgH)
|
.setBgColor(g.theme.bgH)
|
||||||
.fillRect(AR.x, y2 - 3, xr, y2)
|
.fillRect(AR.x, y1, xr, y2)
|
||||||
.clearRect(xr + 1, y2 - 3, AR.x2, y2);
|
.clearRect(xr + 1, y1, AR.x2, y2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// token not visible
|
// token not visible
|
||||||
|
|
Loading…
Reference in New Issue