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

Skip to content

Commit cd88b31

Browse files
committed
Merge pull request #6152 from tacaswell/fix_qt_segfault
FIX: deal with negative canvas dimension in Qt
2 parents 44afc73 + 1540c98 commit cd88b31

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ def draw_idle(self):
172172
QtCore.QTimer.singleShot(0, self.__draw_idle_agg)
173173

174174
def __draw_idle_agg(self, *args):
175+
if self.height() < 0 or self.width() < 0:
176+
self._agg_draw_pending = False
177+
return
175178
try:
176179
FigureCanvasAgg.draw(self)
177180
self.update()

0 commit comments

Comments
 (0)