diff options
| author | Seigo Nonaka <nona@google.com> | 2016-12-14 17:56:10 +0900 |
|---|---|---|
| committer | Seigo Nonaka <nona@google.com> | 2016-12-19 10:35:38 +0900 |
| commit | 9863f67469794af8b63666126e5d60b4eed7cdeb (patch) | |
| tree | a5407a78ec1c67ecf7e7fa25d525bcd5378c68be /core/java/android | |
| parent | 0de5d03c9d6cca001706e93f5e35a95f6320b77b (diff) | |
Fix getLineExtent for hyphen width.
Need to set hyphen edit before measuring line.
Bug: 33388205
Test: Manually done
Change-Id: I32b1639d03ddd9bddb1f3ab34b577544ae358a6a
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/text/Layout.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java index fd6fc7dc0860..3cb81b0a250f 100644 --- a/core/java/android/text/Layout.java +++ b/core/java/android/text/Layout.java @@ -1092,8 +1092,10 @@ public abstract class Layout { int dir = getParagraphDirection(line); TextLine tl = TextLine.obtain(); + mPaint.setHyphenEdit(getHyphen(line)); tl.set(mPaint, mText, start, end, dir, directions, hasTabs, tabStops); float width = tl.metrics(null); + mPaint.setHyphenEdit(0); TextLine.recycle(tl); return width; } @@ -1114,8 +1116,10 @@ public abstract class Layout { int dir = getParagraphDirection(line); TextLine tl = TextLine.obtain(); + mPaint.setHyphenEdit(getHyphen(line)); tl.set(mPaint, mText, start, end, dir, directions, hasTabs, tabStops); float width = tl.metrics(null); + mPaint.setHyphenEdit(0); TextLine.recycle(tl); return width; } |
