[pitivi] Add edge snapping when trimming at start.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] Add edge snapping when trimming at start.
- Date: Thu, 30 Apr 2009 12:18:55 -0400 (EDT)
commit 01e8dbc5350be83c30fac16f51b7231a9693d9d0
Author: Alessandro Decina <alessandro d gmail com>
Date: Tue Apr 28 17:34:35 2009 +0200
Add edge snapping when trimming at start.
Fixes #580172.
---
pitivi/timeline/timeline.py | 3 +++
pitivi/ui/trackobject.py | 2 +-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 2ee4fbd..4715f61 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -202,6 +202,9 @@ class TimelineObject(object, Signallable, Loggable):
if not self.track_objects:
raise TimelineError()
+ if snap:
+ time = self.timeline.snapToEdge(time)
+
for track_object in self.track_objects:
track_object.trimObjectStart(time)
diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py
index 1fbdd3e..743b58c 100644
--- a/pitivi/ui/trackobject.py
+++ b/pitivi/ui/trackobject.py
@@ -82,7 +82,7 @@ class StartHandle(TrimHandle):
def set_pos(self, obj, pos):
new_start = max(self._view.pixelToNs(pos[0]), 0)
- self._view.element.trimStart(new_start)
+ self._view.element.trimStart(new_start, snap=True)
class EndHandle(TrimHandle):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]