File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -140,18 +140,22 @@ def draw_idle(self):
140
140
QtCore .QTimer .singleShot (0 , self .__draw_idle_agg )
141
141
142
142
def __draw_idle_agg (self , * args ):
143
+ # if nothing to do, bail
143
144
if not self ._agg_draw_pending :
144
145
return
146
+ # we have now tried this function at least once, do not run
147
+ # again until re-armed. Doing this here rather than after
148
+ # protects against recursive calls triggered through self.draw
149
+ self ._agg_draw_pending = False
150
+ # if negative size, bail
145
151
if self .height () < 0 or self .width () < 0 :
146
- self ._agg_draw_pending = False
147
152
return
148
153
try :
154
+ # actually do the drawing
149
155
self .draw ()
150
156
except Exception :
151
157
# Uncaught exceptions are fatal for PyQt5, so catch them instead.
152
158
traceback .print_exc ()
153
- finally :
154
- self ._agg_draw_pending = False
155
159
156
160
def blit (self , bbox = None ):
157
161
"""Blit the region in bbox.
You can’t perform that action at this time.
0 commit comments