Commit 61cb6624 authored by luyikei's avatar luyikei

Track.qml: Check entity of linkedClip

parent 75346155
...@@ -294,22 +294,25 @@ Item { ...@@ -294,22 +294,25 @@ Item {
// Let's find newX of the linked clip // Let's find newX of the linked clip
if ( target.linked === true ) { if ( target.linked === true ) {
var linkedClipItem = findClipItem( target.linkedClip ); var linkedClipItem = findClipItem( target.linkedClip );
var newLinkedClipX = findNewPosition( newX, linkedClipItem, isMagneticMode );
// If linked clip collides if ( linkedClipItem ) {
if ( Math.abs( newLinkedClipX - newX ) > 1 ) { var newLinkedClipX = findNewPosition( newX, linkedClipItem, isMagneticMode );
// Recalculate target's newX // If linked clip collides
// This time, don't use magnets if ( Math.abs( newLinkedClipX - newX ) > 1 ) {
newX = findNewPosition( newLinkedClipX, target, false );
newLinkedClipX = findNewPosition( newX, target, false );
// And if newX collides again, we don't move // Recalculate target's newX
if ( Math.abs( newLinkedClipX - newX ) > 1 ) // This time, don't use magnets
newX = oldX; newX = findNewPosition( newLinkedClipX, target, false );
newLinkedClipX = findNewPosition( newX, target, false );
// And if newX collides again, we don't move
if ( Math.abs( newLinkedClipX - newX ) > 1 )
newX = oldX;
}
linkedClipItem.setPixelPosition( newX );
alreadyCalculated.push( target.linkedClip );
} }
linkedClipItem.setPixelPosition( newX );
alreadyCalculated.push( target.linkedClip );
} }
target.setPixelPosition( newX ); target.setPixelPosition( newX );
alreadyCalculated.push( target.uuid ); alreadyCalculated.push( target.uuid );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment