widclkscrl: draw without args
parent
9ea1fe4dcf
commit
7625421a51
|
|
@ -16,14 +16,14 @@
|
||||||
pos: 10,
|
pos: 10,
|
||||||
dir: -1,
|
dir: -1,
|
||||||
eventHandlerSet: false,
|
eventHandlerSet: false,
|
||||||
draw: function(_w, scroll) {
|
draw: function() {
|
||||||
if (!this.eventHandlerSet) {
|
if (!this.eventHandlerSet) {
|
||||||
Bangle.on('lock', (on) => {
|
Bangle.on('lock', (on) => {
|
||||||
this.run(!on);
|
this.run(!on);
|
||||||
});
|
});
|
||||||
this.eventHandlerSet = true;
|
this.eventHandlerSet = true;
|
||||||
}
|
}
|
||||||
if (scroll) {
|
if (this.text) {
|
||||||
const buf = Graphics.createArrayBuffer(WIDTH,24,1,{msb:true}).setFont("Teletext5x9Ascii:1x2").setFontAlign(-1, 0);
|
const buf = Graphics.createArrayBuffer(WIDTH,24,1,{msb:true}).setFont("Teletext5x9Ascii:1x2").setFontAlign(-1, 0);
|
||||||
buf.drawString(this.text, this.pos, 12);
|
buf.drawString(this.text, this.pos, 12);
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
if (!Bangle.CLOCK && on && !this.interval) {
|
if (!Bangle.CLOCK && on && !this.interval) {
|
||||||
this.text = getDateText();
|
this.text = getDateText();
|
||||||
this.interval = setInterval(() => {
|
this.interval = setInterval(() => {
|
||||||
this.draw(this, true);
|
this.draw();
|
||||||
}, 100);
|
}, 100);
|
||||||
this.width = WIDTH+2; Bangle.drawWidgets();
|
this.width = WIDTH+2; Bangle.drawWidgets();
|
||||||
} else if (!on && this.interval) {
|
} else if (!on && this.interval) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue