plotcanvas: avoid trying to adjust scrollbars if nothing drawn

For example, if Clear() is called on a plotcanvas, _adjustScrollbars()
will not work, so avoid trying to do it if nothing is drawn currently.
This commit is contained in:
Scott Talbert
2022-01-11 19:55:51 -05:00
parent 77fa6cf8cc
commit b2199e299a

View File

@@ -707,7 +707,8 @@ class PlotCanvas(wx.Panel):
def _do_update():
self.Layout()
self._adjustScrollbars()
if self.last_draw is not None:
self._adjustScrollbars()
wx.CallAfter(_do_update)
def SetUseScientificNotation(self, useScientificNotation):