Draggable: Grid will snap at >= half rather than just >

This commit is contained in:
Dave Stein 2013-01-07 11:35:18 -05:00
parent 7ad8f54a5a
commit 1495a61298

View File

@ -789,18 +789,18 @@ if ( $.uiBackCompat !== false ) {
// If x is actually something, check that user is at least half way to next point
if ( x ) {
if ( ui.position.left - currentX > x/2 ) {
if ( ui.position.left - currentX >= x/2 ) {
currentX = currentX + x;
} else if ( currentX - ui.position.left > x/2 ) {
} else if ( currentX - ui.position.left >= x/2 ) {
currentX = currentX - x;
}
}
// If y is actually something, check that user is at least half way to next point
if ( y ) {
if ( ui.position.top - currentY > y/2 ) {
if ( ui.position.top - currentY >= y/2 ) {
currentY = currentY + y;
} else if ( currentY - ui.position.top > y/2 ) {
} else if ( currentY - ui.position.top >= y/2 ) {
currentY = currentY - y;
}
}