[pitivi] timeline/elements: clamp timestamps and values.



commit 7f6a73a1a4180fe2c6e121b84e8c400daf1ae9d7
Author: Mathieu Duponchelle <mathieu duponchelle epitech eu>
Date:   Tue Jun 25 15:00:36 2013 +0200

    timeline/elements: clamp timestamps and values.

 pitivi/timeline/elements.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 35b1c57..bd04ef9 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -719,11 +719,9 @@ class Keyframe(Clutter.Actor):
         newTs = self.tsStart + Zoomable.pixelToNs(delta_x)
         newValue = self.valueStart - (delta_y / EXPANDED_SIZE)
 
-        if newTs < self.inpoint or newTs > self.duration:
-            return False
+        newTs = min(max(newTs, self.inpoint), self.duration)
 
-        if newValue < 0.0 or newValue > 1.0:
-            return False
+        newValue = min(max(newValue, 0.0), 1.0)
 
         if not self.has_changable_time:
             newTs = self.lastTs


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