Skip to content

Commit

Permalink
do not allow zoom_level <= 0
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Jan 11, 2024
1 parent 6d4a433 commit 5a4cdeb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3373,6 +3373,11 @@ def _on_value_changed(self, msg):
helper = getattr(glue_state, f'{glue_name}_helper')
value = [choice for choice in helper.choices if str(choice) == msg['new']][0]
setattr(glue_state, glue_name, value)
elif glue_name in ('zoom_level') and msg['new'] <= 0:
# ignore if negative number (otherwise would fail)
self.value = msg['old']
self._processing_change_to_glue = False
return
else:
setattr(glue_state, glue_name, msg['new'])

Expand Down

0 comments on commit 5a4cdeb

Please sign in to comment.