From 73e54d0e0f5516d2f4a066e86e88ebc3c1fb2a1c Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 11 Jul 2024 11:05:45 -0400 Subject: [PATCH] delay callback when calling previous zoom (#2949) --- CHANGES.rst | 2 ++ jdaviz/core/tools.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index b41a3ca757..fb73de5a42 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -192,6 +192,8 @@ Bug Fixes - Fixes exporting the stretch histogram from Plot Options before the Plot Options plugin is ever opened. [#2934] +- Previous zoom tool is optimized to only issue one zoom update to the viewer. [#2949] + Cubeviz ^^^^^^^ diff --git a/jdaviz/core/tools.py b/jdaviz/core/tools.py index 161b545df2..cae2bc86a6 100644 --- a/jdaviz/core/tools.py +++ b/jdaviz/core/tools.py @@ -151,7 +151,8 @@ def activate(self): return prev_limits = self.viewer._prev_limits self.save_prev_zoom() - self.viewer.state.x_min, self.viewer.state.x_max, self.viewer.state.y_min, self.viewer.state.y_max = prev_limits # noqa + with delay_callback(self.viewer.state, 'x_min', 'x_max', 'y_min', 'y_max'): + self.viewer.state.x_min, self.viewer.state.x_max, self.viewer.state.y_min, self.viewer.state.y_max = prev_limits # noqa @viewer_tool