Skip to content

Commit

Permalink
plotcanvas: avoid trying to adjust scrollbars if nothing drawn
Browse files Browse the repository at this point in the history
For example, if Clear() is called on a plotcanvas, _adjustScrollbars()
will not work, so avoid trying to do it if nothing is drawn currently.
  • Loading branch information
swt2c committed Jan 12, 2022
1 parent 77fa6cf commit b2199e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wx/lib/plot/plotcanvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ def showScrollbars(self, value):

def _do_update():
self.Layout()
self._adjustScrollbars()
if self.last_draw is not None:
self._adjustScrollbars()
wx.CallAfter(_do_update)

def SetUseScientificNotation(self, useScientificNotation):
Expand Down

0 comments on commit b2199e2

Please sign in to comment.