Add back mx/mn updates for L1-in-view, lost during rebase

incr_update_backup
Tyler Goodlet 2022-05-02 11:40:53 -04:00
parent 69d0555180
commit 2e6b7da4bc
1 changed files with 4 additions and 3 deletions

View File

@ -364,7 +364,7 @@ def graphics_update_cycle(
mx = mx_in_view + tick_margin mx = mx_in_view + tick_margin
mn = mn_in_view - tick_margin mn = mn_in_view - tick_margin
profiler('maxmin call') profiler('maxmin call')
liv = r > i_step # the last datum is in view liv = r >= i_step # the last datum is in view
# don't real-time "shift" the curve to the # don't real-time "shift" the curve to the
# left unless we get one of the following: # left unless we get one of the following:
@ -372,7 +372,6 @@ def graphics_update_cycle(
( (
i_diff > 0 # no new sample step i_diff > 0 # no new sample step
and xpx < 4 # chart is zoomed out very far and xpx < 4 # chart is zoomed out very far
and r >= i_step # the last datum isn't in view
and liv and liv
) )
or trigger_all or trigger_all
@ -587,6 +586,7 @@ def graphics_update_cycle(
main_vb._ic is None main_vb._ic is None
or not main_vb._ic.is_set() or not main_vb._ic.is_set()
): ):
# print(f'updating range due to mxmn')
main_vb._set_yrange( main_vb._set_yrange(
# TODO: we should probably scale # TODO: we should probably scale
# the view margin based on the size # the view margin based on the size
@ -597,6 +597,7 @@ def graphics_update_cycle(
yrange=(mn, mx), yrange=(mn, mx),
) )
# XXX: update this every draw cycle to make L1-always-in-view work.
vars['last_mx'], vars['last_mn'] = mx, mn vars['last_mx'], vars['last_mn'] = mx, mn
# run synchronous update on all linked flows # run synchronous update on all linked flows