483019. no need for Math.abs when multiplying two numbers together. r=gavin

This commit is contained in:
Doug Turner 2009-03-13 14:11:02 -07:00
parent 25f28968db
commit 98f95a2220

View File

@ -335,7 +335,7 @@ ChromeInputModule.prototype = {
let dy = dragData.sY - aEvent.screenY;
if (!dragData.dragging && dragData.dragStartTimeout != -1) {
if ((Math.abs(dx*dx) + Math.abs(dy*dy)) > 100) {
if (dx*dx + dy*dy > 100) {
clearTimeout(dragData.dragStartTimeout);
this._dragStart(aEvent.screenX, aEvent.screenY);
}
@ -546,7 +546,7 @@ ContentPanningModule.prototype = {
let dy = dragData.sY - aEvent.screenY;
if (!dragData.dragging && dragData.dragStartTimeout != -1) {
if ((Math.abs(dx*dx) + Math.abs(dy*dy)) > 100) {
if (dx*dx + dy*dy > 100) {
clearTimeout(dragData.dragStartTimeout);
this._dragStart(aEvent.screenX, aEvent.screenY);
}