From 33e602326871db3f11b9b3c44a7bddfe01434907 Mon Sep 17 00:00:00 2001 From: Tom Wallroth Date: Sat, 16 Nov 2024 18:51:42 +0100 Subject: [PATCH] rest 0.02: use built-in rounded rect drawing, faster UI --- apps/rest/ChangeLog | 1 + apps/rest/metadata.json | 2 +- apps/rest/rest.app.js | 14 +------------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/apps/rest/ChangeLog b/apps/rest/ChangeLog index 5453557bc..de60dda1f 100644 --- a/apps/rest/ChangeLog +++ b/apps/rest/ChangeLog @@ -1 +1,2 @@ 0.01: First Release +0.02: Use built-in rounded-rect draw function, faster UI \ No newline at end of file diff --git a/apps/rest/metadata.json b/apps/rest/metadata.json index bdce75cd6..6f9cd97ab 100644 --- a/apps/rest/metadata.json +++ b/apps/rest/metadata.json @@ -1,7 +1,7 @@ { "id": "rest", "name": "Rest - Workout Timer App", "shortName":"Rest", - "version": "0.01", + "version": "0.02", "description": "Rest timer and Set counter for workout, fitness and lifting things.", "icon": "app.png", "screenshots": [{"url": "screenshot1.png"}, {"url": "screenshot2.png"}, {"url": "screenshot3.png"}], diff --git a/apps/rest/rest.app.js b/apps/rest/rest.app.js index aeb066e55..8564d8206 100644 --- a/apps/rest/rest.app.js +++ b/apps/rest/rest.app.js @@ -1,18 +1,6 @@ function roundRect (x1, y1, x2, y2, halfrad) { - const fullrad = halfrad + halfrad - const bgColor = g.getBgColor(); - const fgColor = g.getColor(); - g.fillRect(x1, y1, x2, y2); - g.setColor(bgColor).fillRect(x1, y1, x1 + halfrad, y1 + halfrad); - g.setColor(fgColor).fillEllipse(x1, y1, x1 + fullrad, y1 + fullrad); - g.setColor(bgColor).fillRect(x2 - halfrad, y1, x2, y1 + halfrad); - g.setColor(fgColor).fillEllipse(x2 - fullrad, y1, x2, y1 + fullrad); - - g.setColor(bgColor).fillRect(x1, y2-halfrad, x1 + halfrad, y2); - g.setColor(fgColor).fillEllipse(x1, y2-fullrad, x1 + fullrad, y2); - g.setColor(bgColor).fillRect(x2 - halfrad, y2-halfrad, x2, y2); - g.setColor(fgColor).fillEllipse(x2 - fullrad, y2-fullrad, x2, y2); + g.fillRect({x:x1, y:y1, x2:x2, y2:y2, r: halfrad}); } function center(r) {