File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -416,7 +416,21 @@ def stop_event_loop(self):
416
416
stop_event_loop .__doc__ = FigureCanvasBase .stop_event_loop_default .__doc__
417
417
418
418
def draw_idle (self ):
419
- self .update ()
419
+ # This cannot be a call to 'update', we need a slightly longer
420
+ # delay, otherwise mouse releases from zooming, panning, or
421
+ # lassoing might not finish processing and will not redraw properly.
422
+ # We use the guard flag to prevent infinite calls to 'draw_idle' which
423
+ # happens with the 'stale' figure & axes callbacks.
424
+ d = self ._idle
425
+ self ._idle = False
426
+
427
+ def idle_draw (* args ):
428
+ try :
429
+ self .draw ()
430
+ finally :
431
+ self ._idle = True
432
+ if d :
433
+ QtCore .QTimer .singleShot (0 , idle_draw )
420
434
421
435
422
436
class MainWindow (QtWidgets .QMainWindow ):
2ADB
stop>
You can’t perform that action at this time.
0 commit comments