mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 10:10:32 +00:00
timeline: fix timestamp binary search
Fixes dragging the mouse over bigger gaps of log activity making the red position rectangle come out next to the mouse pointer. Also selects the proper row now, not randomly 1-2 rows before or after the gap.
This commit is contained in:
parent
3a90836f82
commit
7b57fe2423
1 changed files with 3 additions and 3 deletions
|
@ -60,12 +60,12 @@ class LineFrequencySentinel (object):
|
|||
while True:
|
||||
middle = (last_index - first_index) // 2 + first_index
|
||||
if middle == first_index:
|
||||
return last_index
|
||||
return first_index
|
||||
ts = model_get (model_iter_nth_child (None, middle), col_id)
|
||||
if ts < target_ts:
|
||||
first_index = middle + 1
|
||||
first_index = middle
|
||||
elif ts > target_ts:
|
||||
last_index = middle - 1
|
||||
last_index = middle
|
||||
else:
|
||||
return middle
|
||||
|
||||
|
|
Loading…
Reference in a new issue