mirror of https://github.com/espruino/BangleApps
actually fixed spacing
parent
ef3087ac4b
commit
af6108de4e
|
@ -1,31 +1,31 @@
|
|||
function draw() {
|
||||
var dt = new Date();
|
||||
var h = dt.getHours(), m = dt.getMinutes();
|
||||
const t = [];
|
||||
t[0] = Math.floor(h/10);
|
||||
t[1] = Math.floor(h%10);
|
||||
t[2] = Math.floor(m/10);
|
||||
t[3] = Math.floor(m%10);
|
||||
var h = dt.getHours(), m = dt.getMinutes();
|
||||
const t = [];
|
||||
t[0] = Math.floor(h/10);
|
||||
t[1] = Math.floor(h%10);
|
||||
t[2] = Math.floor(m/10);
|
||||
t[3] = Math.floor(m%10);
|
||||
|
||||
g.reset();
|
||||
g.clearRect(Bangle.appRect);
|
||||
g.reset();
|
||||
g.clearRect(Bangle.appRect);
|
||||
|
||||
let i = 0;
|
||||
const sq = 29;
|
||||
const gap = 8;
|
||||
let i = 0;
|
||||
const sq = 29;
|
||||
const gap = 8;
|
||||
const mgn = 20;
|
||||
const pos = sq + gap;
|
||||
const pos = sq + gap;
|
||||
|
||||
for (let r = 3; r >= 0; r--) {
|
||||
for (let c = 0; c < 4; c++) {
|
||||
if (t[c] & Math.pow(2, r)) {
|
||||
g.fillRect(mgn/2 + gap + c * pos, mgn + gap + i * pos, mgn/2 + gap + c * pos + sq, mgn + gap + i * pos + sq);
|
||||
} else {
|
||||
g.drawRect(mgn/2 + gap + c * pos, mgn + gap + i * pos, mgn/2 + gap + c * pos + sq, mgn + gap + i * pos + sq);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
for (let r = 3; r >= 0; r--) {
|
||||
for (let c = 0; c < 4; c++) {
|
||||
if (t[c] & Math.pow(2, r)) {
|
||||
g.fillRect(mgn/2 + gap + c * pos, mgn + gap + i * pos, mgn/2 + gap + c * pos + sq, mgn + gap + i * pos + sq);
|
||||
} else {
|
||||
g.drawRect(mgn/2 + gap + c * pos, mgn + gap + i * pos, mgn/2 + gap + c * pos + sq, mgn + gap + i * pos + sq);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
g.clear();
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
"id": "binaryclk",
|
||||
"name": "Bin Clock",
|
||||
"version": "0.01",
|
||||
"description": "Clock face to binary time in 24 hr format",
|
||||
"icon": "app.png",
|
||||
"screenshots": [{"url":"screenshot.png"}],
|
||||
"type": "clock",
|
||||
"tags": "clock",
|
||||
"supports": ["BANGLEJS2"],
|
||||
"allow_emulator": true,
|
||||
"storage": [
|
||||
{"name":"binaryclk.app.js","url":"app.js"},
|
||||
{"name":"binaryclk.img","url":"app-icon.js","evaluate":true}
|
||||
]
|
||||
"id": "binaryclk",
|
||||
"name": "Bin Clock",
|
||||
"version": "0.01",
|
||||
"description": "Clock face to binary time in 24 hr format",
|
||||
"icon": "app.png",
|
||||
"screenshots": [{"url":"screenshot.png"}],
|
||||
"type": "clock",
|
||||
"tags": "clock",
|
||||
"supports": ["BANGLEJS2"],
|
||||
"allow_emulator": true,
|
||||
"storage": [
|
||||
{"name":"binaryclk.app.js","url":"app.js"},
|
||||
{"name":"binaryclk.img","url":"app-icon.js","evaluate":true}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue