hwid-batt: factor width

master
Rob Pilling 2023-06-11 12:40:36 +01:00
parent a3042f206a
commit 60287b7252
1 changed files with 3 additions and 2 deletions

View File

@ -24,7 +24,7 @@
function draw() {
if (typeof old_x === 'undefined') old_x = this.x;
if (typeof old_y === 'undefined') old_y = this.y;
var s = 29;
var s = width - 1;
var x = this.x;
var y = this.y;
if ((typeof x === 'undefined') || (typeof y === 'undefined')) {
@ -65,6 +65,7 @@
Bangle.on('charging',function(charging) { draw(); });
var id = setInterval(()=>WIDGETS["hwid_a_battery_widget"].draw(), intervalLow);
var width = 30;
WIDGETS["hwid_a_battery_widget"]={area:"tr",width:30,draw:draw};
WIDGETS["hwid_a_battery_widget"]={area:"tr",width,draw:draw};
})();