mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 772436 - Fix rounding errors in slide to close tabs. r=mfinkle
This commit is contained in:
parent
1953f2f366
commit
f3dcbb67ab
@ -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 the user was dragging horizontally, check to see if we should close the tab
|
||||||
if (dir == DragDirection.HORIZONTAL) {
|
if (dir == DragDirection.HORIZONTAL) {
|
||||||
int finalPos = 0;
|
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
|
// 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();
|
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();
|
finalPos = mView.getWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user