Commit a782f3c2 authored by luyikei's avatar luyikei

Track.qml: Fix typo

parent 6373d704
...@@ -54,17 +54,17 @@ Item { ...@@ -54,17 +54,17 @@ Item {
var oldX = target.pixelPosition(); var oldX = target.pixelPosition();
if ( useMagneticMode === true ) { if ( useMagneticMode === true ) {
var leastDestance = magneticMargin; var leastDistance = magneticMargin;
// Check two times // Check two times
for ( var k = 0; k < 2; ++k ) { for ( var k = 0; k < 2; ++k ) {
for ( var j = 0; j < markers.count; ++j ) { for ( var j = 0; j < markers.count; ++j ) {
var mx = ftop( markers.get( j ).position ); var mx = ftop( markers.get( j ).position );
if ( Math.abs( newX - mx ) < leastDestance ) { if ( Math.abs( newX - mx ) < leastDistance ) {
leastDestance = Math.abs( newX - mx ); leastDistance = Math.abs( newX - mx );
newX = mx; newX = mx;
} }
else if ( Math.abs( newX + target.width - mx ) < leastDestance ) { else if ( Math.abs( newX + target.width - mx ) < leastDistance ) {
leastDestance = Math.abs( newX + target.width - mx ); leastDistance = Math.abs( newX + target.width - mx );
newX = mx - target.width; newX = mx - target.width;
} }
} }
......
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