runplus: fix drawing of stat when zoomed
parent
f543b86eae
commit
768437219e
|
|
@ -124,8 +124,7 @@ function zoom(statID) {
|
||||||
const onTouch = () => {
|
const onTouch = () => {
|
||||||
Bangle.removeListener("touch", onTouch);
|
Bangle.removeListener("touch", onTouch);
|
||||||
Bangle.removeListener("twist", onTwist);
|
Bangle.removeListener("twist", onTwist);
|
||||||
if (runInterval) clearInterval(runInterval);
|
stat.removeListener("changed", draw);
|
||||||
runInterval = undefined;
|
|
||||||
setScreen("main");
|
setScreen("main");
|
||||||
};
|
};
|
||||||
Bangle.on("touch", onTouch); // queued after layout's touchHandler (otherwise we'd be removed then instantly re-zoomed)
|
Bangle.on("touch", onTouch); // queued after layout's touchHandler (otherwise we'd be removed then instantly re-zoomed)
|
||||||
|
|
@ -135,7 +134,7 @@ function zoom(statID) {
|
||||||
};
|
};
|
||||||
Bangle.on("twist", onTwist);
|
Bangle.on("twist", onTwist);
|
||||||
|
|
||||||
const draw = () => {
|
const draw = stat => {
|
||||||
const R = Bangle.appRect;
|
const R = Bangle.appRect;
|
||||||
|
|
||||||
g.reset()
|
g.reset()
|
||||||
|
|
@ -144,7 +143,6 @@ function zoom(statID) {
|
||||||
|
|
||||||
layout.render(layout.bottom);
|
layout.render(layout.bottom);
|
||||||
|
|
||||||
const stat = exs.stats[statID];
|
|
||||||
g
|
g
|
||||||
.setFont(zoomFont)
|
.setFont(zoomFont)
|
||||||
.setColor(headingCol)
|
.setColor(headingCol)
|
||||||
|
|
@ -154,9 +152,9 @@ function zoom(statID) {
|
||||||
};
|
};
|
||||||
layout.lazy = false; // restored when we go back to "main"
|
layout.lazy = false; // restored when we go back to "main"
|
||||||
|
|
||||||
if (runInterval) clearInterval(runInterval);
|
const stat = exs.stats[statID];
|
||||||
runInterval = setInterval(draw, 1000);
|
stat.on("changed", draw);
|
||||||
draw();
|
draw(stat);
|
||||||
}
|
}
|
||||||
|
|
||||||
let lc = [];
|
let lc = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue