From 89a3974626db0f63526b01ed6d3442c6e5c744a1 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Wed, 20 Oct 2021 00:37:09 -0400 Subject: [PATCH] Clear canvas the right way --- command_prompt.py | 1 + cross.py | 3 +-- status_bar.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/command_prompt.py b/command_prompt.py index aa70bbb..0801d62 100644 --- a/command_prompt.py +++ b/command_prompt.py @@ -41,6 +41,7 @@ class Command_prompt(Label): def draw(self): + self.canvas.before.clear() # background with self.canvas.before: diff --git a/cross.py b/cross.py index 455659c..be952d9 100644 --- a/cross.py +++ b/cross.py @@ -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() diff --git a/status_bar.py b/status_bar.py index 8b0e81e..ee42a14 100644 --- a/status_bar.py +++ b/status_bar.py @@ -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))]