From dd84dbf23248e7fb606f2c3396d4579e11df19ff Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Tue, 29 Oct 2024 12:01:24 +0000 Subject: [PATCH] Make resetting limits be immediate --- glue_jupyter/bqplot/image/viewer.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/glue_jupyter/bqplot/image/viewer.py b/glue_jupyter/bqplot/image/viewer.py index 16895b1e..40444015 100644 --- a/glue_jupyter/bqplot/image/viewer.py +++ b/glue_jupyter/bqplot/image/viewer.py @@ -54,6 +54,15 @@ def __init__(self, session, compression='png'): on_change([(self.state, 'aspect')])(self._sync_figure_aspect) self._sync_figure_aspect() + def _update_bqplot_limits(self, *args, **kwargs): + # When the user explicitly changes the limits, we want the update to + # be immediate - debouncing should be ideally used mostly for preventing + # many successive updates from the front-end, e.g. when panning, but + # programmatically changing things should be immediate. + super()._update_bqplot_limits(*args, **kwargs) + if hasattr(self, '_composite_image'): + self._composite_image.update() + def _update_axes(self, *args): if self.state.x_att_world is not None: