mirror of
https://github.com/wassname/scikit-image.git
synced 2026-10-03 12:50:25 +08:00
ENH: Handle redraw edge case.
You can call redraw before the first draw event so that the background never gets saved. In this case, skip blitting so we don't need the background image.
This commit is contained in:
1 parent
8e4f24af00
commit
e98476ea41
1 file changed
+2
-1
@@ -23,6 +23,7 @@ class CanvasToolBase(object):
|
||||
useblit=True):
|
||||
self.ax = ax
|
||||
self.canvas = ax.figure.canvas
|
||||
self.img_background = None
|
||||
self.cids = []
|
||||
self._artists = []
|
||||
self.active = True
|
||||
@@ -76,7 +77,7 @@ class CanvasToolBase(object):
|
||||
|
||||
This method should be called by subclasses when artists are updated.
|
||||
"""
|
||||
if self.useblit:
|
||||
if self.useblit and self.img_background is not None:
|
||||
self.canvas.restore_region(self.img_background)
|
||||
self._draw_artists()
|
||||
self.canvas.blit(self.ax.bbox)
|
||||
|
||||
Reference in new issue
Block a user