File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,18 +140,22 @@ def draw_idle(self):
140140 QtCore .QTimer .singleShot (0 , self .__draw_idle_agg )
141141
142142 def __draw_idle_agg (self , * args ):
143+ # if nothing to do, bail
143144 if not self ._agg_draw_pending :
144145 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
145151 if self .height () < 0 or self .width () < 0 :
146- self ._agg_draw_pending = False
147152 return
148153 try :
154+ # actually do the drawing
149155 self .draw ()
150156 except Exception :
151157 # Uncaught exceptions are fatal for PyQt5, so catch them instead.
152158 traceback .print_exc ()
153- finally :
154- self ._agg_draw_pending = False
155159
156160 def blit (self , bbox = None ):
157161 """Blit the region in bbox.
You can’t perform that action at this time.
0 commit comments