Skip to content

Commit 577b071

Browse files
committed
Fix for 7281523 android.text.cts.SelectionTest#testMoveRight failures
The failures were caused by the implementation of doTextRunCursor passing a too-small value for contextCount into the underlying getTextRunAdvances call (it wasn't accounting for the start offset). Thus, when getTextRunAdvances made a copy of the text for its cache key, it was getting a partial copy. This patch fixes the size so the cache key always has a full copy of the text. Change-Id: I57e3ac6de7aef0e1f1c7000dc3d653f9b0d623d2
1 parent 82b9464 commit 577b071

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/jni/android/graphics/Paint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ class SkPaintGlue {
629629
jint count, jint flags, jint offset, jint opt) {
630630
jfloat scalarArray[count];
631631

632-
TextLayout::getTextRunAdvances(paint, text, start, count, count, flags,
632+
TextLayout::getTextRunAdvances(paint, text, start, count, start + count, flags,
633633
scalarArray, NULL /* dont need totalAdvance */);
634634

635635
jint pos = offset - start;

0 commit comments

Comments
 (0)