1
0
Fork 0

Merge pull request #2301 from halemmerich/widgetutils

widget_utils - Prevent initial draw clearing on global g
master
Gordon Williams 2022-11-21 10:45:32 +00:00 committed by GitHub
commit 6554c1a9d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -42,6 +42,10 @@ exports.cleanup = function() {
clearTimeout(exports.hideTimeout);
delete exports.hideTimeout;
}
if (exports.origDraw) {
Bangle.drawWidgets = exports.origDraw;
delete exports.origDraw;
}
}
/** Put widgets offscreen, and allow them to be swiped
@ -85,7 +89,13 @@ exports.swipeOn = function() {
if (w.area.startsWith("b"))
w.area = "t"+w.area.substr(1);
}
Bangle.drawWidgets();
exports.origDraw = Bangle.drawWidgets;
Bangle.drawWidgets = ()=>{
g=og;
exports.origDraw();
g=_g;
};
function anim(dir, callback) {
if (exports.animInterval) clearInterval(exports.interval);