Previously the offset between the touch event and the start / end of
the word could result in a negative value - we don't care or want
this value to be negative. The negative value also causes the returned
offset to be outside the bounds of the text which resulted in a crash.
Bug:
19705184
Change-Id: I4287df7778c246dd10654f1a1f1e57538e940730
}
}
mPrevOffset = offset;
- mTouchWordOffset = trueOffset - offset;
+ mTouchWordOffset = Math.max(trueOffset - offset, 0);
mInWord = !isStartBoundary(offset);
positionCursor = true;
} else if (offset - mTouchWordOffset > mPrevOffset) {
}
}
mPrevOffset = offset;
- mTouchWordOffset = offset - trueOffset;
+ mTouchWordOffset = Math.max(offset - trueOffset, 0);
mInWord = !isEndBoundary(offset);
positionCursor = true;
} else if (offset + mTouchWordOffset < mPrevOffset) {