Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7c4e9f commit bcfd4f5Copy full SHA for bcfd4f5
examples/event_handling/poly_editor.py
@@ -59,7 +59,8 @@ def draw_callback(self, event):
59
self.background = self.canvas.copy_from_bbox(self.ax.bbox)
60
self.ax.draw_artist(self.poly)
61
self.ax.draw_artist(self.line)
62
- self.canvas.blit(self.ax.bbox)
+ # do not need to blit here, this will fire before the screen is
63
+ # updated
64
65
def poly_changed(self, poly):
66
'this method is called whenever the polygon object is called'
@@ -131,8 +132,8 @@ def key_press_callback(self, event):
131
132
axis=0)
133
self.line.set_data(zip(*self.poly.xy))
134
break
-
135
- self.canvas.draw()
+ if self.line.stale:
136
+ self.canvas.draw_idle()
137
138
def motion_notify_callback(self, event):
139
'on mouse movement'
0 commit comments