|
From: <cpa...@ce...> - 2016-05-17 11:49:29
|
From: cpascual <cpa...@ce...>
In TaurusTrend2D, setting the autoscroll before the model triggers a bug
that permanently sets the scale range to min,max = 0,0, preventing
correct display of the data. Fix it by ignoring scroll requests before
the axis is properly set.
---
lib/taurus/qt/qtgui/extra_guiqwt/tools.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/tools.py b/lib/taurus/qt/qtgui/extra_guiqwt/tools.py
index ae03eb3..4521312 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/tools.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/tools.py
@@ -251,6 +251,9 @@ class AutoScrollTool(ToggleTool, BaseConfigurableClass):
def onScrollRequested(self, plot, axis, value):
scalemin, scalemax = plot.get_axis_limits(axis)
scaleRange = abs(scalemax - scalemin)
+ # ignore requests that imply setting a null range
+ if scaleRange == 0:
+ return
xmin = value - scaleRange * (1. - self.scrollFactor)
xmax = value + scaleRange * self.scrollFactor
plot.set_axis_limits(axis, xmin, xmax)
--
2.8.1
|