From: Eduardo Lundgren Date: Sun, 1 Jun 2008 13:52:50 +0000 (+0000) Subject: userAction fix for top when not defined X-Git-Tag: 1.5.1~247 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=985a82c66069de78693868af0a010ca299fdd93d;p=jquery-ui.git userAction fix for top when not defined --- diff --git a/ui/tests/jquery.useraction.js b/ui/tests/jquery.useraction.js index 510a42e68..b7e19a009 100644 --- a/ui/tests/jquery.useraction.js +++ b/ui/tests/jquery.useraction.js @@ -152,7 +152,7 @@ $.extend($.userAction.prototype, { self.down(target); var mdx = Math.abs(dx)||0, mdy = Math.abs(dy)||0, range = Math.max(mdx, mdy), - sx = dx/mdx, sy = dy/mdy; + sx = dx/mdx||1, sy = dy/mdy||1; for (var dt = 1; dt <= range; dt++) { var x = center.x + sx*(dt <= mdx ? dt : 0), y = center.y + sy*(dt <= mdy ? dt : 0);