Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1540c98

Browse filesBrowse files
committed
FIX: deal with negative canvas dimension in Qt
In some cases Qt may report having a negative height (and presumably width) in the case of minimizing windows / widgets. This causes issues at the Agg layer when the re-size triggers a re-draw which tries to get a renderer with a negative dimension (segfaults or OutOfMemory errors).
1 parent eadeb1a commit 1540c98
Copy full SHA for 1540c98

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed

‎lib/matplotlib/backends/backend_qt5agg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt5agg.py
+3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.