Fix off-by-one error causing display of spurious line when clamping with filter turned on
authorRené Stadler <mail@renestadler.de>
Tue, 18 Dec 2007 13:26:05 +0000 (15:26 +0200)
committerStefan Sauer <ensonic@users.sf.net>
Thu, 11 Sep 2014 18:51:43 +0000 (20:51 +0200)
debug-viewer/GstDebugViewer/GUI.py

index 69df80f..6c5849a 100644 (file)
@@ -573,7 +573,7 @@ class FilteredLogModel (FilteredLogModelBase):
 
         last_index = len (self.line_offsets) - 1
         if end_index < last_index:
-            self.__remove_range (end_index + 1, last_index - 1)
+            self.__remove_range (end_index + 1, last_index)
 
         if start_index > 0:
             self.__remove_range (0, start_index - 1)
@@ -1669,13 +1669,14 @@ class Window (object):
         try:
             line_index = self.get_active_line_index ()
         except ValueError:
+            super_index = None
             self.logger.debug ("no line selected")
-            selected_index = None
         else:
-            self.logger.debug ("pushing selected line %i", line_index)
-            selected_index = model.line_index_to_top (line_index)
+            super_index = model.line_index_to_top (line_index)
+            self.logger.debug ("pushing selected line %i (abs %i)",
+                               line_index, super_index)
 
-        self.default_index = selected_index
+        self.default_index = super_index
 
     def update_model (self, model = None):