Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b15984

Browse files
committed
Fix order of execution in paintEvent
1 parent 31408af commit 6b15984

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ def paintEvent(self, e):
6666
shown onscreen.
6767
"""
6868

69+
# if the canvas does not have a renderer, then give up and wait for
70+
# FigureCanvasAgg.draw(self) to be called
71+
if not hasattr(self, 'renderer'):
72+
return
73+
6974
# As described in __init__ above, we need to be careful in cases with
7075
# mixed resolution displays if dpi_ratio is changing between painting
7176
# events.
@@ -83,11 +88,6 @@ def paintEvent(self, e):
8388
self.resizeEvent(event)
8489
self._dpi_ratio_prev = self._dpi_ratio
8590

86-
# if the canvas does not have a renderer, then give up and wait for
87-
# FigureCanvasAgg.draw(self) to be called
88-
if not hasattr(self, 'renderer'):
89-
return
90-
9191
painter = QtGui.QPainter(self)
9292

9393
if self._bbox_queue:

0 commit comments

Comments
 (0)