[pitivi] elements: Keyframes no longer merge when dragged close to each other
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] elements: Keyframes no longer merge when dragged close to each other
- Date: Sun, 26 Feb 2017 00:39:19 +0000 (UTC)
commit c6251a3b593d08e36fa8bd429459fdbb6c3ed363
Author: Stefan Popa <stefanpopa2209 gmail com>
Date: Sun Feb 26 01:25:07 2017 +0100
elements: Keyframes no longer merge when dragged close to each other
When dragging keyframes close to each other, they sometimes merged. This
happened because we were inserting elements with the same timestamp in
the dictionary holding keyframes.
Fixes T7716
Reviewed-by: Alex Băluț <alexandru balut gmail com>
Differential Revision: https://phabricator.freedesktop.org/D1683
pitivi/timeline/elements.py | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 37ceae2..4e08053 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -393,12 +393,12 @@ class KeyframeCurve(FigureCanvas, Loggable):
return event.xdata
i = values.index(kf)
- if event.xdata > self.__offset:
- if values[i + 1].timestamp < event.xdata:
- return max(0, values[i + 1].timestamp - 1)
- else:
- if i > 1 and values[i - 1].timestamp > event.xdata:
- return values[i - 1].timestamp + 1
+ keyframe_timestamp = int(event.xdata)
+ if keyframe_timestamp <= values[i - 1].timestamp:
+ keyframe_timestamp = values[i - 1].timestamp + 1
+ if keyframe_timestamp >= values[i + 1].timestamp:
+ keyframe_timestamp = values[i + 1].timestamp - 1
+ return keyframe_timestamp
return event.xdata
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]