Skip to content

Commit

Permalink
Zoom in after completely zooming out
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Sep 15, 2020
1 parent 816038f commit 6ca4f83
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion labelme/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

import functools
import math
import os
import os.path as osp
import re
Expand Down Expand Up @@ -1331,7 +1332,12 @@ def setZoom(self, value):
self.zoom_values[self.filename] = (self.zoomMode, value)

def addZoom(self, increment=1.1):
self.setZoom(self.zoomWidget.value() * increment)
zoom_value = self.zoomWidget.value() * increment
if increment > 1:
zoom_value = math.ceil(zoom_value)
else:
zoom_value = math.floor(zoom_value)
self.setZoom(zoom_value)

def zoomRequest(self, delta, pos):
canvas_width_old = self.canvas.width()
Expand Down

0 comments on commit 6ca4f83

Please sign in to comment.