summaryrefslogtreecommitdiff
path: root/core/java/android/text/TextLine.java
diff options
context:
space:
mode:
authorSeigo Nonaka <nona@google.com>2020-10-19 23:14:04 -0700
committerSeigo Nonaka <nona@google.com>2020-10-19 23:31:35 -0700
commit170e0949f3c67decaa67d3fcce6a9776268691ff (patch)
treedc52a8c628df2c8f25088f7181b29678fa17cc25 /core/java/android/text/TextLine.java
parent276718dee090fd9613c6149dee89e87619f97ee5 (diff)
Fix wrong offset of BiDi text by TextShaper
This CL includes: - Fix relative offset of BidiRun by reviving width calculation in TextLine. - Fix bidi level buffer offset. It shuold be relative to the substring, but the absolute offset was passed. - Removed paint argument from PositionedGlyph which is not used. Bug: 171275519 Test: atest android.graphics.text.cts.TextRunShaperTest Test: atest android.text.cts.TextShaperTest Change-Id: I36949089d744bdfae61995210b2051866a7510ac
Diffstat (limited to 'core/java/android/text/TextLine.java')
-rw-r--r--core/java/android/text/TextLine.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/text/TextLine.java b/core/java/android/text/TextLine.java
index 4471056e23dd..6318c4757bce 100644
--- a/core/java/android/text/TextLine.java
+++ b/core/java/android/text/TextLine.java
@@ -931,7 +931,8 @@ public class TextLine {
float totalWidth = 0;
final int numDecorations = decorations == null ? 0 : decorations.size();
- if (needWidth || (c != null && (wp.bgColor != 0 || numDecorations != 0 || runIsRtl))) {
+ if (needWidth || ((c != null || consumer != null) && (wp.bgColor != 0
+ || numDecorations != 0 || runIsRtl))) {
totalWidth = getRunAdvance(wp, start, end, contextStart, contextEnd, runIsRtl, offset);
}