From c765f38197998a0420105950f113f46a8ed00b97 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Wed, 19 Jun 2024 18:40:00 +0100 Subject: [PATCH] hwid batt: whitespace --- apps/hwid_a_battery_widget/widget.js | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/hwid_a_battery_widget/widget.js b/apps/hwid_a_battery_widget/widget.js index 7c76364a0..84fa32e0c 100644 --- a/apps/hwid_a_battery_widget/widget.js +++ b/apps/hwid_a_battery_widget/widget.js @@ -21,30 +21,30 @@ }; function draw() { - var s = width - 1; - var x = this.x; - var y = this.y; - if (x !== undefined && y !== undefined) { - g.setBgColor(COLORS.white); - g.clearRect(old_x, old_y, old_x + width, old_y + height); + var s = width - 1; + var x = this.x; + var y = this.y; + if (x !== undefined && y !== undefined) { + g.setBgColor(COLORS.white); + g.clearRect(old_x, old_y, old_x + width, old_y + height); - const l = E.getBattery(); // debug: Math.floor(Math.random() * 101); - let xl = x+4+l*(s-12)/100; + const l = E.getBattery(); // debug: Math.floor(Math.random() * 101); + let xl = x+4+l*(s-12)/100; - g.setColor(levelColor(l)); - g.fillRect(x+4,y+14+3,xl,y+16+3); // charging bar - // Show percentage - g.setColor(COLORS.black); - g.setFontAlign(0,0); - g.setFont('Vector',16); - g.drawString(l, x + 14, y + 10); + g.setColor(levelColor(l)); + g.fillRect(x+4,y+14+3,xl,y+16+3); // charging bar + // Show percentage + g.setColor(COLORS.black); + g.setFontAlign(0,0); + g.setFont('Vector',16); + g.drawString(l, x + 14, y + 10); - } + } old_x = this.x; old_y = this.y; - if (Bangle.isCharging()) changeInterval(id, intervalHigh); - else changeInterval(id, intervalLow); + if (Bangle.isCharging()) changeInterval(id, intervalHigh); + else changeInterval(id, intervalLow); } Bangle.on('charging',function(charging) { draw(); });