blobclk: Adapt to fillPoly changes

pull/503/head
Ben Whittaker 2020-06-13 21:20:47 -04:00
parent 1658b5f035
commit 5805329248
3 changed files with 6 additions and 5 deletions

View File

@ -869,7 +869,7 @@
"name": "Large Digit Blob Clock",
"shortName" : "Blob Clock",
"icon": "clock-blob.png",
"version":"0.03",
"version":"0.04",
"description": "A clock with big digits",
"tags": "clock",
"type":"clock",

View File

@ -2,3 +2,4 @@
Only draw widgets after clearing screen - they update automatically
Remove 'faceUp' check as it's automatic
0.03: Modified for use with new bootloader and firmware
0.04: Modified to account for changes in the behavior of Graphics.fillPoly

View File

@ -18,8 +18,8 @@ function flip() {
g.drawImage({width:buf.getWidth(),height:buf.getHeight(),buffer:buf.buffer},55,26);
}
function drawPixel(ox,oy,x,y,r,p) {
let x1 = ox+x*(r*2+1);
let y1 = oy+y*(r*2+1);
let x1 = ox+x*(r*2);
let y1 = oy+y*(r*2);
let xmid = x1+r;
let ymid = y1+r;
let x2 = xmid+r;
@ -27,14 +27,14 @@ function drawPixel(ox,oy,x,y,r,p) {
if (p > 0) {
if (p > 1) {
buf.setColor(0,0,0);
buf.fillRect(x1,y1,x2,y2);
buf.fillPoly([x1,y1,x2,y1,x2,y2,x1,y2]);
}
buf.setColor(1,1,1);
} else {
buf.setColor(0,0,0);
}
if (p < 2) {
buf.fillRect(x1,y1,x2,y2);
buf.fillPoly([x1,y1,x2,y1,x2,y2,x1,y2]);
} else if (p === 2) {
buf.fillPoly([xmid,y1,x2,y1,x2,y2,x1,y2,x1,ymid]);
} else if (p === 3) {