From 9bbfa4be02f270e6fbbccb6e7d86615b48baa87e Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 4 Apr 2022 10:43:44 -0400 Subject: [PATCH] Guard against zero px width --- piker/ui/_curve.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/piker/ui/_curve.py b/piker/ui/_curve.py index 59dbc0e5..26016342 100644 --- a/piker/ui/_curve.py +++ b/piker/ui/_curve.py @@ -341,7 +341,8 @@ class FastAppendCurve(pg.GraphicsObject): # check for downsampling conditions if ( # std m4 downsample conditions - uppx_diff >= 2 + px_width + and uppx_diff >= 2 or uppx_diff <= -2 or self._step_mode and abs(uppx_diff) >= 2 @@ -350,7 +351,7 @@ class FastAppendCurve(pg.GraphicsObject): f'{self._name} sampler change: {self._last_uppx} -> {uppx}' ) self._last_uppx = uppx - should_ds = {'px_width': px_width, 'uppx': uppx} + should_ds = True elif ( uppx <= 2 @@ -410,7 +411,8 @@ class FastAppendCurve(pg.GraphicsObject): x_out, y_out = self.downsample( x_out, y_out, - **should_ds, + px_width, + uppx, ) profiler(f'FULL PATH downsample redraw={should_ds}') self._in_ds = True