Rect wont show on step curves unless we avoid `.draw_last()`

incremental_update_paths
Tyler Goodlet 2022-05-18 08:46:09 -04:00
parent 4c7661fc23
commit 1dab77ca0b
1 changed files with 12 additions and 15 deletions

View File

@ -739,21 +739,16 @@ class Flow(msgspec.Struct): # , frozen=True):
# ``FastAppendCurve`` case: # ``FastAppendCurve`` case:
array_key = array_key or self.name array_key = array_key or self.name
shm = self.shm
# update config
new_sample_rate = False new_sample_rate = False
should_ds = self._in_ds should_ds = self._in_ds
showing_src_data = self._in_ds showing_src_data = self._in_ds
draw_last: bool = True
# draw_last: bool = True
slice_to_head: int = -1 slice_to_head: int = -1
should_redraw: bool = False should_redraw: bool = False
shm = self.shm
# if a view range is passed, plan to draw the
# source ouput that's "in view" of the chart.
view_range = (ivl, ivr) if use_vr else None
if out is not None: if out is not None:
# hack to handle ds curve from bars above # hack to handle ds curve from bars above
( (
@ -828,6 +823,7 @@ class Flow(msgspec.Struct): # , frozen=True):
) )
should_redraw = bool(append_diff) should_redraw = bool(append_diff)
draw_last = False
# graphics.reset_cache() # graphics.reset_cache()
# print( # print(
@ -841,10 +837,6 @@ class Flow(msgspec.Struct): # , frozen=True):
# the input data and the last indexes we have on record from the # the input data and the last indexes we have on record from the
# last time we updated the curve index. # last time we updated the curve index.
prepend_length, append_length = r.diff(read) prepend_length, append_length = r.diff(read)
# print((prepend_length, append_length))
# old_prepend_length = int(istart - x[0])
# old_append_length = int(x[-1] - istop)
# MAIN RENDER LOGIC: # MAIN RENDER LOGIC:
# - determine in view data and redraw on range change # - determine in view data and redraw on range change
@ -852,10 +844,14 @@ class Flow(msgspec.Struct): # , frozen=True):
# - (incrementally) update ``QPainterPath`` # - (incrementally) update ``QPainterPath``
if ( if (
view_range use_vr
# and not self._in_ds # and not self._in_ds
# and not prepend_length > 0 # and not prepend_length > 0
): ):
# if a view range is passed, plan to draw the
# source ouput that's "in view" of the chart.
view_range = (ivl, ivr)
# print(f'{self._name} vr: {view_range}') # print(f'{self._name} vr: {view_range}')
# by default we only pull data up to the last (current) index # by default we only pull data up to the last (current) index
@ -1096,8 +1092,9 @@ class Flow(msgspec.Struct): # , frozen=True):
# **kwargs # **kwargs
# ) # )
graphics.draw_last(x, y) if draw_last:
profiler('draw last segment') graphics.draw_last(x, y)
profiler('draw last segment')
graphics.update() graphics.update()
profiler('.update()') profiler('.update()')