Lines Matching defs:offset

88     // Returns the offset of the replacement span edge if the offset is inside of the replacement
89 // span. Otherwise, does nothing and returns the input offset value.
90 private static int adjustReplacementSpan(CharSequence text, int offset, boolean moveToStart) {
92 return offset;
95 ReplacementSpan[] spans = ((Spanned) text).getSpans(offset, offset, ReplacementSpan.class);
100 if (start < offset && end > offset) {
101 offset = moveToStart ? start : end;
104 return offset;
107 // Returns the start offset to be deleted by a backspace key from the given offset.
108 private static int getOffsetForBackspaceKey(CharSequence text, int offset) {
109 if (offset <= 1) {
116 // The offset is immediately before line feed.
119 // The offset is immediately before a KEYCAP.
121 // The offset is immediately before a variation selector and a KEYCAP.
124 // The offset is immediately before an emoji modifier.
126 // The offset is immediately before a variation selector and an emoji modifier.
129 // The offset is immediately before a variation selector.
132 // The offset is immediately before a ZWJ emoji.
134 // The offset is immediately before a ZWJ that were seen before a ZWJ emoji.
136 // The offset is immediately before a variation selector and a ZWJ that were seen before a
153 int tmpOffset = offset;
278 return adjustReplacementSpan(text, offset - deleteCharCount, true /* move to the start */);
281 // Returns the end offset to be deleted by a forward delete key from the given offset.
282 private static int getOffsetForForwardDeleteKey(CharSequence text, int offset, Paint paint) {
285 if (offset >= len - 1) {
289 offset = paint.getTextRunCursor(text, offset, len, Paint.DIRECTION_LTR /* not used */,
290 offset, Paint.CURSOR_AFTER);
292 return adjustReplacementSpan(text, offset, false /* move to the end */);