Skip to content

Commit e27cf05

Browse files
authored
Merge pull request espruino#3662 from devsnd/rest-0.02
rest 0.02: use built-in rounded rect drawing, faster UI
2 parents 5211884 + 33e6023 commit e27cf05

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

apps/rest/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
0.01: First Release
2+
0.02: Use built-in rounded-rect draw function, faster UI

apps/rest/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ "id": "rest",
22
"name": "Rest - Workout Timer App",
33
"shortName":"Rest",
4-
"version": "0.01",
4+
"version": "0.02",
55
"description": "Rest timer and Set counter for workout, fitness and lifting things.",
66
"icon": "app.png",
77
"screenshots": [{"url": "screenshot1.png"}, {"url": "screenshot2.png"}, {"url": "screenshot3.png"}],

apps/rest/rest.app.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11

22
function roundRect (x1, y1, x2, y2, halfrad) {
3-
const fullrad = halfrad + halfrad
4-
const bgColor = g.getBgColor();
5-
const fgColor = g.getColor();
6-
g.fillRect(x1, y1, x2, y2);
7-
g.setColor(bgColor).fillRect(x1, y1, x1 + halfrad, y1 + halfrad);
8-
g.setColor(fgColor).fillEllipse(x1, y1, x1 + fullrad, y1 + fullrad);
9-
g.setColor(bgColor).fillRect(x2 - halfrad, y1, x2, y1 + halfrad);
10-
g.setColor(fgColor).fillEllipse(x2 - fullrad, y1, x2, y1 + fullrad);
11-
12-
g.setColor(bgColor).fillRect(x1, y2-halfrad, x1 + halfrad, y2);
13-
g.setColor(fgColor).fillEllipse(x1, y2-fullrad, x1 + fullrad, y2);
14-
g.setColor(bgColor).fillRect(x2 - halfrad, y2-halfrad, x2, y2);
15-
g.setColor(fgColor).fillEllipse(x2 - fullrad, y2-fullrad, x2, y2);
3+
g.fillRect({x:x1, y:y1, x2:x2, y2:y2, r: halfrad});
164
}
175

186
function center(r) {

0 commit comments

Comments
 (0)