From dabb6dc72c26eac92f3fc890ff12de0270bdf894 Mon Sep 17 00:00:00 2001 From: Denis Buzdalov Date: Wed, 11 Dec 2024 13:19:07 +0300 Subject: [PATCH] [ minor, codestyle ] Fix inconsistent indentation --- apps/andark/app.js | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/apps/andark/app.js b/apps/andark/app.js index b607e3698..42ca5fda1 100644 --- a/apps/andark/app.js +++ b/apps/andark/app.js @@ -12,9 +12,9 @@ const zahlpos=(function() { let z=[]; let sk=1; for(let i=-10;i<50;i+=5){ - let win=i*2*Math.PI/60; - let xsk =c.x+2+Math.cos(win)*(c.x-10), - ysk =c.y+2+Math.sin(win)*(c.x-10); + let win=i*2*Math.PI/60; + let xsk =c.x+2+Math.cos(win)*(c.x-10), + ysk =c.y+2+Math.sin(win)*(c.x-10); if(sk==3){xsk-=10;} if(sk==6){ysk-=10;} if(sk==9){xsk+=10;} @@ -26,8 +26,7 @@ const zahlpos=(function() { return z; })(); - -let zeiger = function(len,dia,tim){ +let zeiger = function(len,dia,tim) { const x=c.x+ Math.cos(tim)*len/2, y=c.y + Math.sin(tim)*len/2, d={"d":3,"x":dia/2*Math.cos(tim+Math.PI/2),"y":dia/2*Math.sin(tim+Math.PI/2)}, @@ -81,7 +80,7 @@ let drawNumbers = function() { g.setColor(1,1,1); g.setBgColor(0,0,0); for(let i = 0;i<12;i++){ - g.drawString(zahlpos[i][0],zahlpos[i][1],zahlpos[i][2],true); + g.drawString(zahlpos[i][0],zahlpos[i][1],zahlpos[i][2],true); } }; @@ -96,7 +95,7 @@ let queueDraw = function() { }, queueMillis - (Date.now() % queueMillis)); }; -let draw = function(){ +let draw = function() { // draw black rectangle in the middle to clear screen from scale and hands g.setColor(0,0,0); g.fillRect(10,10,2*c.x-10,2*c.x-10); @@ -114,7 +113,7 @@ let draw = function(){ }; //draws the scale once the app is startet -let drawScale = function(){ +let drawScale = function() { // clear the screen g.setBgColor(0,0,0); g.clear(); @@ -141,7 +140,8 @@ Bangle.setUI({ Bangle.removeListener('lcdPower', updateState); Bangle.removeListener('lock', updateState); require("widget_utils").show(); -}}); + } +}); // Load widgets if needed, and make them show swipeable if (settings.loadWidgets) { Bangle.loadWidgets(); @@ -149,24 +149,23 @@ if (settings.loadWidgets) { } else if (global.WIDGETS) require("widget_utils").hide(); let updateState = function() { - if (Bangle.isLCDOn()) { - if (!Bangle.isLocked()) { - queueMillis = 1000; - unlock = true; - } else { - queueMillis = 60000; - unlock = false; - } - draw(); - } else { + if (Bangle.isLCDOn()) { + if (!Bangle.isLocked()) { + queueMillis = 1000; + unlock = true; + } else { + queueMillis = 60000; + unlock = false; + } + draw(); + } else { if (drawTimeout) clearTimeout(drawTimeout); drawTimeout = undefined; - } + } }; // Stop updates when LCD is off, restart when on Bangle.on('lcdPower', updateState); - Bangle.on('lock', updateState); let unlock = true;