[pitivi: 13/20] timeline.py: fix calculation of span
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi: 13/20] timeline.py: fix calculation of span
- Date: Wed, 15 Jul 2009 06:37:59 +0000 (UTC)
commit b52817b9035ee7dc24864c327695bb860bc28f73
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date: Tue Jul 14 18:14:17 2009 -0700
timeline.py: fix calculation of span
pitivi/timeline/timeline.py | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 0586da7..d77d905 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1043,6 +1043,7 @@ class MoveContext(EditingContext):
# calculate minimum start time and priority
self.earliest = focus.start
self.min_priority = focus.priority
+ self.latest = focus.start + focus.duration
timeline_objects = []
self.default_originals = {}
@@ -1053,15 +1054,14 @@ class MoveContext(EditingContext):
if timeline_object.start < self.earliest:
self.earliest = timeline_object.start
+ self.latest = max(self.latest, timeline_object.start +
+ timeline_object.duration)
+
if timeline_object.priority < self.min_priority:
self.min_priority = timeline_object.min_priority
self.default_originals = self._saveValues(timeline_objects)
- # get list clips for ripple editing
- ripple = set(timeline.getObjsAfterObj(focus))
-
- # calculate offsets of clips relative to earliest time, min priority
self.offsets = self._getOffsets(self.focus.start, self.focus.priority,
timeline_objects)
@@ -1069,15 +1069,10 @@ class MoveContext(EditingContext):
focus.priority - self.min_priority)
ripple = timeline.getObjsAfterObj(focus)
+ # get the span over all clips for edge snapping
+ self.default_span = self.latest - self.earliest
- self.ripple_offsets = self._getOffsets(self.earliest,
- self.min_priority, ripple)
- # get the span over all clips for edge snapping
- self.default_span = self._getSpan(self.earliest,
- set(timeline_objects) | set((focus,)))
- self.ripple_span = self._getSpan(self.earliest,
- set(ripple) | set((focus,)))
# save default values
self.default_originals = self._saveValues(other)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]