From 1495a6129892ab303e8854e9e39cfc1c968fd569 Mon Sep 17 00:00:00 2001 From: Dave Stein Date: Mon, 7 Jan 2013 11:35:18 -0500 Subject: [PATCH] Draggable: Grid will snap at >= half rather than just > --- ui/jquery.ui.draggable.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index e62b5ccf8..8e0d9358c 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -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; } }