~nagos/openshot/nagos

« back to all changes in this revision

Viewing changes to openshot/windows/MainGTK.py

  • Committer: Vladimir Yakovlev
  • Date: 2010-03-02 11:43:33 UTC
  • mfrom: (206.1.9 openshot-empty)
  • Revision ID: nagos@inbox.ru-20100302114333-5x1ng9c6cr0ijj0a
Bug with overlaying clips

Show diffs side-by-side

added added

removed removed

Lines of Context:
1148
1148
                
1149
1149
                all_clips = sorted(all_clips)
1150
1150
                for clip in all_clips:
1151
 
                        index = all_clips.index(clip)-1
 
1151
                        index = all_clips.index(clip)
1152
1152
                        space = 0
1153
 
                        if index == -1 :
 
1153
                        if index == 0 :
1154
1154
                                space = clip.position_on_track
1155
 
                        elif index >= 0:
1156
 
                                prev = all_clips[index]
 
1155
                        elif index > 0:
 
1156
                                prevs=filter(lambda x: x.position_on_track < clip.position_on_track, all_clips)
 
1157
                                prev = max(prevs,key=lambda x: x.position_on_track+x.length())
1157
1158
                                space = clip.position_on_track - \
1158
1159
                                        (prev.position_on_track+prev.length())
1159
1160
                        if space > 0: moveClips(clip.position_on_track,space)