Skip to content
Closed
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
8 changes: 6 additions & 2 deletions lib/matplotlib/backends/backend_qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,12 @@ def resizeEvent(self, event):
# the rendered buffer is useless before anyways.
if self._dpi_ratio_prev is None:
return
w = event.size().width() * self._dpi_ratio
h = event.size().height() * self._dpi_ratio
width = event.size().width()
height = event.size().height()
if width <= 0 or height <= 0:
return
w = width * self._dpi_ratio
h = height * self._dpi_ratio
dpival = self.figure.dpi
winch = w / dpival
hinch = h / dpival
Expand Down