From f3dcbb67ab965d7d5d9f185dc1845e7374145f5b Mon Sep 17 00:00:00 2001 From: Wes Johnston Date: Tue, 10 Jul 2012 11:17:21 -0700 Subject: [PATCH] Bug 772436 - Fix rounding errors in slide to close tabs. r=mfinkle --- mobile/android/base/TabsTray.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/android/base/TabsTray.java b/mobile/android/base/TabsTray.java index eb24d349efd..375be56b112 100644 --- a/mobile/android/base/TabsTray.java +++ b/mobile/android/base/TabsTray.java @@ -344,11 +344,11 @@ public class TabsTray extends LinearLayout // if the user was dragging horizontally, check to see if we should close the tab if (dir == DragDirection.HORIZONTAL) { int finalPos = 0; - // if the swipe started on the left and ended in the right 1/4 of the tray + // if the swipe started on the left and ended in the right 25% of the tray // or vice versa, close the tab - if ((start.x > mList.getWidth() / 2 && e.getX() < mList.getWidth() / 4)) { + if ((start.x > mList.getWidth() / 2 && e.getX() < mList.getWidth() * 0.25 )) { finalPos = -1 * mView.getWidth(); - } else if (start.x < mList.getWidth() / 2 && e.getX() > mList.getWidth() * (3 / 4)) { + } else if (start.x < mList.getWidth() / 2 && e.getX() > mList.getWidth() * 0.75) { finalPos = mView.getWidth(); }