diff --git a/jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.py b/jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.py index f356676a4e..e17d539a39 100644 --- a/jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.py +++ b/jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.py @@ -153,9 +153,18 @@ def vue_center_on_data(self, event=None): if not self.viewer_selected or self.viewer_selected == "Manual": return + # If the user panned but tracking not enabled, don't recenter + # NOTE: float event typecheck assumes the only "float" type event triggering this method + # is "zoom_center_x" and "zoom_center_y" + # Otherwise, need some other way to determine the event = user panning + if isinstance(event, float) and not self.coord_follow_viewer_pan: + # Thus, we're no longer centered + self.viewer_centered = False + return + self.center_on_data(event) - def center_on_data(self, event=None): + def center_on_data(self, _=None): """ If data is present in the default viewer, center the plugin's coordinates on the viewer's center WCS coordinates. @@ -164,14 +173,6 @@ def center_on_data(self, event=None): # mixin object not yet initialized return - # If the user panned but tracking not enabled, don't recenter - # NOTE: float event typecheck assumes the only "float" type event triggering this method - # is "zoom_center_x" and "zoom_center_y" - # Otherwise, need some other way to determine the event = user panning - if isinstance(event, float) and not self.coord_follow_viewer_pan: - # Thus, we're no longer centered - self.viewer_centered = False - return # gets the current viewer viewer = self.viewer.selected_obj