fix a bug in join clips

This commit is contained in:
rlx 2013-08-10 11:22:38 +00:00
parent 5f06d88238
commit 026574c43f

View file

@ -407,9 +407,12 @@ Ox.ClipPanel = function(options, self) {
Ox.forEach(clips, function(inClip, index) { Ox.forEach(clips, function(inClip, index) {
var inPoint = inClip.item + '/' + inClip['in']; var inPoint = inClip.item + '/' + inClip['in'];
if (inPoint == outPoint) { if (inPoint == outPoint) {
ids = ids.concat([outClip.id, inClip.id]); ids = Ox.unique(ids.concat([outClip.id, inClip.id]));
join.push(outClip.id); join = Ox.unique(join.concat([outClip.id]));
outClip.out = inClip.out; outClip.out = inClip.out;
if (Ox.contains(join, inClip.id)) {
join.splice(join.indexOf(inClip.id), 1);
}
clips.splice(index, 1); clips.splice(index, 1);
joined = true; joined = true;
return false; // break return false; // break
@ -420,8 +423,7 @@ Ox.ClipPanel = function(options, self) {
} }
}); });
} while (joined); } while (joined);
ids = Ox.unique(ids); join = join.map(function(id) {
join = Ox.unique(join).map(function(id) {
var clip = Ox.getObjectById(clips, id); var clip = Ox.getObjectById(clips, id);
return {'in': clip['in'], item: clip.item, out: clip.out}; return {'in': clip['in'], item: clip.item, out: clip.out};
}); });