Skip to content

Commit

Permalink
Simplify xcen logic [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Jul 23, 2021
1 parent a794999 commit 8f44f3e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions jdaviz/configs/imviz/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8f44f3e

Please sign in to comment.