Clear canvas the right way

This commit is contained in:
Ian Jauslin 2021-10-20 00:37:09 -04:00
parent e650923bc7
commit 89a3974626
3 changed files with 2 additions and 3 deletions

View File

@ -41,6 +41,7 @@ class Command_prompt(Label):
def draw(self):
self.canvas.before.clear()
# background
with self.canvas.before:

View File

@ -226,12 +226,12 @@ class Cross_painter(Widget):
def reset(self):
self.crosses=[]
self.selected=None
self.canvas.clear()
self.draw()
# draw all crosses
def draw(self):
self.canvas.clear()
with self.canvas:
for cross in self.crosses:
cross.draw()
@ -270,7 +270,6 @@ class Cross_painter(Widget):
if touch.button=="left" and self.selected!=None:
self.selected.pos=self.check_move(Point(touch.x/Cross.size,touch.y/Cross.size),self.selected)
# redraw
self.canvas.clear()
self.draw()

View File

@ -39,6 +39,5 @@ class Status_bar(Label):
if self.app.readonly:
self.raw_text+=" [RO]"
# do not wrap
self.text=self.raw_text[:min(len(self.raw_text),int(self.width/self.char_width))]