File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,8 @@ def _qt_seek(self, t):
131131 sr = self .controller .sampling_frequency
132132
133133 self .scroll_time .valueChanged .disconnect (self ._qt_on_scroll_time )
134- value = self .controller .time_to_sample_index (t )
134+ sample = self .controller .time_to_sample_index (t )
135+ value = int (sample / self .scroll_step )
135136 self .scroll_time .setValue (value )
136137 self .scroll_time .setPageStep (int (sr * xsize ))
137138 self .scroll_time .valueChanged .connect (self ._qt_on_scroll_time )
Original file line number Diff line number Diff line change 1313# * segment change
1414# *
1515
16+ INT32_MAX = 2147483647 # 2**31 - 1
17+
18+
1619class MixinViewTrace :
1720
1821 MAX_RETRIEVE_TIME_FOR_BUSY_CURSOR = 0.5 # seconds
@@ -214,7 +217,7 @@ def _qt_initialize_plot(self):
214217 def _qt_update_scroll_step (self ):
215218 segment_index = self .controller .get_time ()[1 ]
216219 length = self .controller .get_num_samples (segment_index )
217- num_scrollbar_steps = max ( 2 ** 16 , length )
220+ num_scrollbar_steps = min ( INT32_MAX , length )
218221 self .scroll_step = length / num_scrollbar_steps
219222
220223 t_start , t_stop = self .controller .get_t_start_t_stop ()
You can’t perform that action at this time.
0 commit comments