Skip to content

Commit

Permalink
Bind zoom listeners to menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruned committed Apr 22, 2024
1 parent 703f4cd commit 37580c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cocoviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ def __init__(self, data, root, image_panel, statusbar, menu, objects_panel, slid
self.menu.view.entryconfigure("BBoxes", variable=self.bboxes_on_global, command=self.menu_view_bboxes)
self.menu.view.entryconfigure("Labels", variable=self.labels_on_global, command=self.menu_view_labels)
self.menu.view.entryconfigure("Masks", variable=self.masks_on_global, command=self.menu_view_masks)
self.menu.view.entryconfigure("Zoom In", command=self.zoom_in)
self.menu.view.entryconfigure("Zoom Out", command=self.zoom_out)
self.menu.view.colormenu.entryconfigure(
"Categories",
variable=self.coloring_on_global,
Expand Down Expand Up @@ -853,11 +855,11 @@ def label_slider_status_update(self):
def masks_slider_status_update(self):
self.sliders.mask_slider.configure(state=tk.NORMAL if self.masks_on_local else tk.DISABLED)

def zoom_in(self, event):
def zoom_in(self, event=None):
self.zoom_factor *= self.ZOOM_STEP
self.update_img(local=False)

def zoom_out(self, event):
def zoom_out(self, event=None):
self.zoom_factor /= self.ZOOM_STEP
self.update_img(local=False)

Expand Down

0 comments on commit 37580c3

Please sign in to comment.