[pitivi] curve.py: only move the current segment when user clicks and drags on a curve
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] curve.py: only move the current segment when user clicks and drags on a curve
- Date: Tue, 4 Aug 2009 07:49:39 +0000 (UTC)
commit 7d6cdd2387dd37e93bcd1a5c8e2787c13897e882
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date: Mon Aug 3 16:07:01 2009 -0700
curve.py: only move the current segment when user clicks and drags on a curve
fixes bug 589813
pitivi/ui/curve.py | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/ui/curve.py b/pitivi/ui/curve.py
index c85e5ef..f8c0073 100644
--- a/pitivi/ui/curve.py
+++ b/pitivi/ui/curve.py
@@ -67,6 +67,8 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
# we are moving the entire curve, so we need to know the
# inital position of each keyframe
self._offsets = dict(self._view.keyframes)
+ self._segment = self._view.findSegment(
+ self.xyToTimeValue(initial)[0])
def drag_end(self, item, target, event):
self._kf = None
@@ -79,7 +81,7 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
self._kf.time = time
self._kf.value = value
else:
- for kf in interpolator.keyframes:
+ for kf in self._segment:
time, value = self.xyToTimeValue(self._offsets[kf] + pos
- self.pos(self._view))
kf.value = value
@@ -250,3 +252,14 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
between(ky - KW_HEIGHT2, y, ky + KW_HEIGHT2)):
return keyframe
return None
+
+ def findSegment(self, time):
+ before = self.interpolator.start
+ after = self.interpolator.end
+ for keyframe in self.keyframes.iterkeys():
+ if between(before.time, keyframe.time, time):
+ before = keyframe
+ if between(time, keyframe.time, after.time):
+ after = keyframe
+ assert before.time <= after.time
+ return before, after
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]