From 9fcc6f9c44f83c10799ca4cb266bd59bc00f980a Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 8 Dec 2022 15:58:11 -0500 Subject: [PATCH] Restore coord-cache resetting Turns out we can't seem to avoid the artefacts when click-drag-scrolling (results in weird repeated "smeared" curve segments) so just go back to the original code. --- piker/ui/_render.py | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/piker/ui/_render.py b/piker/ui/_render.py index 9f03c189..18219be6 100644 --- a/piker/ui/_render.py +++ b/piker/ui/_render.py @@ -718,30 +718,27 @@ class Viz(msgspec.Struct): # , frozen=True): path, data, reset = out - # if self.yrange: - # print(f'viz {self.name} yrange from m4: {self.yrange}') - # XXX: SUPER UGGGHHH... without this we get stale cache # graphics that don't update until you downsampler again.. - # if reset: - # with graphics.reset_cache(): - # # assign output paths to graphicis obj - # graphics.path = r.path - # graphics.fast_path = r.fast_path + if reset: + with graphics.reset_cache(): + # assign output paths to graphicis obj + graphics.path = r.path + graphics.fast_path = r.fast_path - # # XXX: we don't need this right? - # # graphics.draw_last_datum( - # # path, - # # src_array, - # # reset, - # # array_key, - # # ) - # # graphics.update() - # # profiler('.update()') - # else: - # assign output paths to graphicis obj - graphics.path = r.path - graphics.fast_path = r.fast_path + # XXX: we don't need this right? + # graphics.draw_last_datum( + # path, + # src_array, + # reset, + # array_key, + # ) + # graphics.update() + # profiler('.update()') + else: + # assign output paths to graphicis obj + graphics.path = r.path + graphics.fast_path = r.fast_path graphics.draw_last_datum( path,