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

FIX: deal with negative canvas dimension in Qt #6152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).
  • Loading branch information
tacaswell committed Mar 14, 2016
commit 1540c98eb91c685f0a15e4de4de3b85611f73194
3 changes: 3 additions & 0 deletions 3 lib/matplotlib/backends/backend_qt5agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ def draw_idle(self):
QtCore.QTimer.singleShot(0, self.__draw_idle_agg)

def __draw_idle_agg(self, *args):
if self.height() < 0 or self.width() < 0:
self._agg_draw_pending = False
return
try:
FigureCanvasAgg.draw(self)
self.update()
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.