mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 907881 - Update normal cursor position when moving beyond its bounds in TopSitesCursorWrapper. r=wesj
This commit is contained in:
parent
e43a59734a
commit
ed14d537ac
@ -407,11 +407,16 @@ public class BrowserDB {
|
||||
public boolean moveToPosition(int position) {
|
||||
mIndex = position;
|
||||
|
||||
// move the real cursor as if we were stepping through it to this position
|
||||
// be careful not to move it to far, and to account for any pinned sites
|
||||
// Move the real cursor as if we were stepping through it to this position.
|
||||
// Account for pinned sites, and be careful to update its position to the
|
||||
// minimum or maximum position, even if we're moving beyond its bounds.
|
||||
int before = getPinnedBefore(position);
|
||||
int p2 = position - before;
|
||||
if (p2 >= -1 && p2 <= mCursor.getCount()) {
|
||||
if (p2 <= -1) {
|
||||
super.moveToPosition(-1);
|
||||
} else if (p2 >= mCursor.getCount()) {
|
||||
super.moveToPosition(mCursor.getCount());
|
||||
} else {
|
||||
super.moveToPosition(p2);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user