openshot.code team mailing list archive
-
openshot.code team
-
Mailing list archive
-
Message #00657
[Branch ~openshot.code/openshot/main] Rev 731: Fixed a few bugs related to the new transitions snapping / auto sizing feature
------------------------------------------------------------
revno: 731
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot
timestamp: Sat 2012-09-29 20:24:19 -0500
message:
Fixed a few bugs related to the new transitions snapping / auto sizing feature
modified:
openshot/classes/transition.py
--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main
Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/classes/transition.py'
--- openshot/classes/transition.py 2012-09-11 20:39:47 +0000
+++ openshot/classes/transition.py 2012-09-30 01:24:19 +0000
@@ -500,17 +500,23 @@
bottom_track = self.parent.parent.tracks[track_index + 1]
# get distance from nearby clips (to the Right)
- edges = [self.get_edge_of_clip(new_position_on_track, "right", self.parent, 10.0)]
+ edges = []
+ edge_of_clip = self.get_edge_of_clip(new_position_on_track, "right", self.parent, 10.0)
+ if edge_of_clip:
+ edges.append(edge_of_clip)
if bottom_track:
- edges.append(self.get_edge_of_clip(new_position_on_track, "right", bottom_track, 10.0))
-
+ edge_of_clip = self.get_edge_of_clip(new_position_on_track, "right", bottom_track, 10.0)
+ if edge_of_clip:
+ edges.append(edge_of_clip)
+
# Change length
- if sorted(edges)[0] > new_position_on_track:
- new_length = sorted(edges)[0] - new_position_on_track
-
- if distance_from_clip and self.length != new_length:
- # re-render transition (at correct width)
- self.length = new_length
+ if edges:
+ if sorted(edges)[0] > new_position_on_track:
+ new_length = sorted(edges)[0] - new_position_on_track
+
+ if distance_from_clip and self.length != new_length:
+ # re-render transition (at correct width)
+ self.length = new_length
# Set the new position
self.position_on_track = new_position_on_track