[ocrfeeder] Changed zoom factor and fixed allowed zoom levels
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder] Changed zoom factor and fixed allowed zoom levels
- Date: Wed, 3 Mar 2010 11:53:30 +0000 (UTC)
commit 49f5da0a99283d54b50b6c0c7ad61cb111a87ecf
Author: Joaquim Rocha <jrocha igalia com>
Date: Wed Mar 3 12:45:54 2010 +0100
Changed zoom factor and fixed allowed zoom levels
studio/customWidgets.py | 13 +++++++++----
studio/widgetModeler.py | 4 ++--
2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/studio/customWidgets.py b/studio/customWidgets.py
index 0ea1d1c..73d3481 100644
--- a/studio/customWidgets.py
+++ b/studio/customWidgets.py
@@ -27,7 +27,8 @@ import gettext
_ = gettext.gettext
class SelectableBoxesArea(goocanvas.Canvas):
-
+
+ MINIMUM_ZOOM_HEIGHT = 50
IMAGE_FRAME_THICKNESS = 5
IMAGE_FRAME_COLOR = '#717171'
@@ -137,14 +138,18 @@ class SelectableBoxesArea(goocanvas.Canvas):
def zoom(self, zoom_value, add_zoom = True):
new_zoom = zoom_value
+ set_zoom = False
if add_zoom:
current_zoom = self.get_scale()
new_zoom = current_zoom + zoom_value
- if 2 > new_zoom > 0.2:
- self.set_scale(new_zoom)
+ if new_zoom * self.image.props.height >= self.MINIMUM_ZOOM_HEIGHT:
+ set_zoom = True
else:
+ if new_zoom * self.image.props.height >= self.MINIMUM_ZOOM_HEIGHT:
+ set_zoom = True
+ if set_zoom:
self.set_scale(new_zoom)
- self.emit('changed_zoom', self.get_scale())
+ self.emit('changed_zoom', self.get_scale())
def getImageSize(self):
return self.image.props.height, self.image.props.width
diff --git a/studio/widgetModeler.py b/studio/widgetModeler.py
index f86442b..5c076fc 100644
--- a/studio/widgetModeler.py
+++ b/studio/widgetModeler.py
@@ -575,11 +575,11 @@ class ImageReviewer_Controler:
reviewer.setImageStrokeColor(self.configuration_manager.getImageStroke())
reviewer.updateBoxesColors()
- def zoomIn(self, zoom_value = 0.2):
+ def zoomIn(self, zoom_value = 0.05):
current_reviewer = self.__getCurrentReviewer()
current_reviewer.selectable_boxes_area.zoom(zoom_value)
- def zoomOut(self, zoom_value = -0.2):
+ def zoomOut(self, zoom_value = -0.05):
current_reviewer = self.__getCurrentReviewer()
current_reviewer.selectable_boxes_area.zoom(-abs(zoom_value))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]