iconbits: cleanups.
parent
7ae71e9506
commit
aedb898177
|
|
@ -194,6 +194,9 @@ Bangle.on("lock", function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function __draw (g, from, to) {
|
function __draw (g, from, to) {
|
||||||
|
let XS = (to.x - from.x) / 32;
|
||||||
|
let YS = (to.y - from.y) / 32;
|
||||||
|
|
||||||
switch (pen) {
|
switch (pen) {
|
||||||
case 'pixel':
|
case 'pixel':
|
||||||
g.drawLine(from.x, from.y, to.x, to.y);
|
g.drawLine(from.x, from.y, to.x, to.y);
|
||||||
|
|
@ -204,15 +207,11 @@ Bangle.on("lock", function() {
|
||||||
g.drawLine(from.x + 2, from.y + 2, to.x, to.y + 2);
|
g.drawLine(from.x + 2, from.y + 2, to.x, to.y + 2);
|
||||||
break;
|
break;
|
||||||
case 'circle':
|
case 'circle':
|
||||||
var XS = (to.x - from.x) / 32;
|
|
||||||
var YS = (to.y - from.y) / 32;
|
|
||||||
for (let i = 0; i < 32; i++) {
|
for (let i = 0; i < 32; i++) {
|
||||||
g.fillCircle(from.x + (i * XS), from.y + (i * YS), 2, 2);
|
g.fillCircle(from.x + (i * XS), from.y + (i * YS), 2, 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'square':
|
case 'square':
|
||||||
var XS = (to.x - from.x) / 32;
|
|
||||||
var YS = (to.y - from.y) / 32;
|
|
||||||
for (let i = 0; i < 32; i++) {
|
for (let i = 0; i < 32; i++) {
|
||||||
const posX = from.x + (i * XS);
|
const posX = from.x + (i * XS);
|
||||||
const posY = from.y + (i * YS);
|
const posY = from.y + (i * YS);
|
||||||
|
|
@ -220,7 +219,6 @@ Bangle.on("lock", function() {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue