Clear canvas the right way
This commit is contained in:
parent
e650923bc7
commit
89a3974626
@ -41,6 +41,7 @@ class Command_prompt(Label):
|
|||||||
|
|
||||||
|
|
||||||
def draw(self):
|
def draw(self):
|
||||||
|
self.canvas.before.clear()
|
||||||
|
|
||||||
# background
|
# background
|
||||||
with self.canvas.before:
|
with self.canvas.before:
|
||||||
|
3
cross.py
3
cross.py
@ -226,12 +226,12 @@ class Cross_painter(Widget):
|
|||||||
def reset(self):
|
def reset(self):
|
||||||
self.crosses=[]
|
self.crosses=[]
|
||||||
self.selected=None
|
self.selected=None
|
||||||
self.canvas.clear()
|
|
||||||
self.draw()
|
self.draw()
|
||||||
|
|
||||||
|
|
||||||
# draw all crosses
|
# draw all crosses
|
||||||
def draw(self):
|
def draw(self):
|
||||||
|
self.canvas.clear()
|
||||||
with self.canvas:
|
with self.canvas:
|
||||||
for cross in self.crosses:
|
for cross in self.crosses:
|
||||||
cross.draw()
|
cross.draw()
|
||||||
@ -270,7 +270,6 @@ class Cross_painter(Widget):
|
|||||||
if touch.button=="left" and self.selected!=None:
|
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)
|
self.selected.pos=self.check_move(Point(touch.x/Cross.size,touch.y/Cross.size),self.selected)
|
||||||
# redraw
|
# redraw
|
||||||
self.canvas.clear()
|
|
||||||
self.draw()
|
self.draw()
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,6 +39,5 @@ class Status_bar(Label):
|
|||||||
if self.app.readonly:
|
if self.app.readonly:
|
||||||
self.raw_text+=" [RO]"
|
self.raw_text+=" [RO]"
|
||||||
|
|
||||||
|
|
||||||
# do not wrap
|
# do not wrap
|
||||||
self.text=self.raw_text[:min(len(self.raw_text),int(self.width/self.char_width))]
|
self.text=self.raw_text[:min(len(self.raw_text),int(self.width/self.char_width))]
|
||||||
|
Loading…
Reference in New Issue
Block a user