From 8305ed8dceefb7df11d0d0b567b222e39ad241a2 Mon Sep 17 00:00:00 2001 From: René Stadler Date: Thu, 22 Nov 2007 11:03:09 +0200 Subject: Clamp timeline mouse position to actual range --- GstDebugViewer/Plugins/Timeline.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GstDebugViewer/Plugins/Timeline.py b/GstDebugViewer/Plugins/Timeline.py index 7c1b7c9..195fba6 100644 --- a/GstDebugViewer/Plugins/Timeline.py +++ b/GstDebugViewer/Plugins/Timeline.py @@ -551,6 +551,12 @@ class TimelineFeature (FeatureBase): data = self.timeline.freq_sentinel.data if not data: return True + + if pos < 0: + pos = 0 + elif pos >= len (data): + pos = len (data) - 1 + count = sum (data[:pos + 1]) row = self.log_model[count] -- cgit v1.2.3