[pitivi] timeline: Make sure the zoom level is always an int



commit 5b7369a195ae6782cc41be3524c708ef642b8516
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sat Feb 15 07:17:09 2014 +0100

    timeline: Make sure the zoom level is always an int

 pitivi/utils/timeline.py |    2 +-
 pitivi/utils/widgets.py  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/utils/timeline.py b/pitivi/utils/timeline.py
index 9360881..a5d6f93 100644
--- a/pitivi/utils/timeline.py
+++ b/pitivi/utils/timeline.py
@@ -349,7 +349,7 @@ class Zoomable(object):
 
     @classmethod
     def setZoomLevel(cls, level):
-        level = min(cls.zoom_steps, max(0, level))
+        level = int(max(0, min(level, cls.zoom_steps)))
         if level != cls._cur_zoom:
             cls._cur_zoom = level
             cls.setZoomRatio(cls.computeZoomRatio(level))
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index 3697867..7222061 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -1023,7 +1023,7 @@ class ZoomBox(Gtk.HBox, Zoomable):
         self.show_all()
 
     def _zoomAdjustmentChangedCb(self, adjustment):
-        Zoomable.setZoomLevel(int(adjustment.get_value()))
+        Zoomable.setZoomLevel(adjustment.get_value())
 
     def _zoomFitCb(self, unused_button):
         self.timeline.zoomFit()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]