diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-03-09 00:00:13 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-03-09 00:00:13 (GMT) |
| commit | 031d139b7c31f83791c8c35cc78624aa1eda6da2 (patch) | |
| tree | 0322cf93239101571d3e8b1c29a9e0980313abe0 /wasp/apps/clock.py | |
| parent | 5413d826d7ffe825b759cd013f9f68e9311aee01 (diff) | |
wasp: draw565: Refactor to allow apps to focus on the drawable.
Diffstat (limited to 'wasp/apps/clock.py')
| -rw-r--r-- | wasp/apps/clock.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/wasp/apps/clock.py b/wasp/apps/clock.py index cde39a2..f99091a 100644 --- a/wasp/apps/clock.py +++ b/wasp/apps/clock.py @@ -56,10 +56,10 @@ class ClockApp(object): def draw(self, effect=None): """Redraw the display from scratch.""" - display = watch.display + draw = watch.drawable - display.fill(0) - display.rleblit(digits.clock_colon, pos=(2*48, 80), fg=0xb5b6) + draw.fill() + draw.rleblit(digits.clock_colon, pos=(2*48, 80), fg=0xb5b6) self.on_screen = ( -1, -1, -1, -1, -1, -1 ) self.update() self.meter.draw() @@ -77,14 +77,13 @@ class ClockApp(object): self.on_screen = now return False - display = watch.display - display.rleblit(DIGITS[now[4] % 10], pos=(4*48, 80)) - display.rleblit(DIGITS[now[4] // 10], pos=(3*48, 80), fg=0xbdb6) - display.rleblit(DIGITS[now[3] % 10], pos=(1*48, 80)) - display.rleblit(DIGITS[now[3] // 10], pos=(0*48, 80), fg=0xbdb6) + draw = watch.drawable + draw.rleblit(DIGITS[now[4] % 10], pos=(4*48, 80)) + draw.rleblit(DIGITS[now[4] // 10], pos=(3*48, 80), fg=0xbdb6) + draw.rleblit(DIGITS[now[3] % 10], pos=(1*48, 80)) + draw.rleblit(DIGITS[now[3] // 10], pos=(0*48, 80), fg=0xbdb6) self.on_screen = now - draw = watch.drawable month = now[1] - 1 month = MONTH[month*3:(month+1)*3] draw.string('{} {} {}'.format(now[2], month, now[0]), |
