[pitivi] keyframes: Fix T52



commit 03927ef96a8d5d1e41a1b2c4b1d26c8cb8e347a6
Author: Mathieu Duponchelle <mathieu duponchelle opencreed com>
Date:   Tue May 19 19:30:41 2015 +0200

    keyframes: Fix T52
    
    Summary:
    By preventing the edge keyframe's timestamps to be changed by
    the user.
    
    Reviewers: thiblahute
    
    Differential Revision: http://phabricator.freedesktop.org/D186

 pitivi/timeline/elements.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 8cfc47c..c9fbf48 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -196,6 +196,14 @@ class KeyframeCurve(FigureCanvas, Loggable):
             self.__dragged = True
             # Check that the mouse event still is in the figure boundaries
             if event.ydata is not None and event.xdata is not None:
+
+                # The user can not change the timestamp of the first
+                # and last keyframes.
+                values = self.__source.get_all()
+                if (values[0].timestamp == self.__offset or
+                        values[-1].timestamp == self.__offset):
+                    event.xdata = self.__offset
+
                 self.__source.unset(int(self.__offset))
                 self.__source.set(event.xdata, event.ydata)
                 self.__offset = event.xdata


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