Fixed bug when scroll in and out using wheel mouse in graph, range of data displayed could be out of bounds of whole data stored range
--- a/controls/DebugVariablePanel/DebugVariableGraphicPanel.py Mon Jun 03 11:11:46 2013 +0200
+++ b/controls/DebugVariablePanel/DebugVariableGraphicPanel.py Mon Jun 03 11:52:13 2013 +0200
@@ -507,9 +507,10 @@
if len(self.Ticks) > 0:
if tick is None:
tick = self.StartTick + self.CurrentRange / 2.
- new_start_tick = tick - (tick - self.StartTick) * self.CurrentRange / current_range
+ new_start_tick = min(tick - (tick - self.StartTick) * self.CurrentRange / current_range,
+ self.Ticks[-1] - self.CurrentRange)
self.StartTick = self.Ticks[numpy.argmin(numpy.abs(self.Ticks - new_start_tick))]
- self.Fixed = self.StartTick < self.Ticks[-1] - self.CurrentRange
+ self.Fixed = new_start_tick < self.Ticks[-1] - self.CurrentRange
self.ForceRefresh()
def RefreshRange(self):