From 8f44f3ebe7ad62acae8ba3e6c8862d2d940136e3 Mon Sep 17 00:00:00 2001 From: Pey Lian Lim <2090236+pllim@users.noreply.github.com> Date: Thu, 22 Jul 2021 17:41:32 -0400 Subject: [PATCH] Simplify xcen logic [ci skip] --- jdaviz/configs/imviz/helper.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jdaviz/configs/imviz/helper.py b/jdaviz/configs/imviz/helper.py index 5aa5482523..938e80a64a 100644 --- a/jdaviz/configs/imviz/helper.py +++ b/jdaviz/configs/imviz/helper.py @@ -252,8 +252,7 @@ def zoom_level(self, val): new_x_min = 0 new_x_max = nx else: - width = viewer.state.x_max - viewer.state.x_min - cur_xcen = viewer.state.x_min + (width * 0.5) + cur_xcen = (viewer.state.x_min + viewer.state.x_max) * 0.5 new_dx = nx * 0.5 / val new_x_min = cur_xcen - new_dx new_x_max = cur_xcen + new_dx