mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 907881 - Update normal cursor position when moving beyond its bounds in TopSitesCursorWrapper. r=wesj
This commit is contained in:
parent
d0e3b6fce3
commit
7efee5bdc8
@ -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