Loading core/java/android/text/BoringLayout.java +1 −8 Original line number Diff line number Diff line Loading @@ -347,14 +347,7 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback TextLine line = TextLine.obtain(); line.set(paint, text, 0, textLength, Layout.DIR_LEFT_TO_RIGHT, Layout.DIRS_ALL_LEFT_TO_RIGHT, false, null); if (text instanceof PrecomputedText) { PrecomputedText mt = (PrecomputedText) text; // Reaching here means there is only one paragraph. MeasuredParagraph mp = mt.getMeasuredParagraph(0); fm.width = (int) Math.ceil(mp.getWidth(0, mp.getTextLength())); } else { fm.width = (int) Math.ceil(line.metrics(fm)); } TextLine.recycle(line); return fm; Loading core/java/android/text/TextLine.java +5 −0 Original line number Diff line number Diff line Loading @@ -172,7 +172,12 @@ public class TextLine { mComputed = null; if (text instanceof PrecomputedText) { // Here, no need to check line break strategy or hyphenation frequency since there is no // line break concept here. mComputed = (PrecomputedText) text; if (!mComputed.getParams().getTextPaint().equalsForTextMeasurement(paint)) { mComputed = null; } } mCharsValid = hasReplacement || hasTabs || directions != Layout.DIRS_ALL_LEFT_TO_RIGHT; Loading Loading
core/java/android/text/BoringLayout.java +1 −8 Original line number Diff line number Diff line Loading @@ -347,14 +347,7 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback TextLine line = TextLine.obtain(); line.set(paint, text, 0, textLength, Layout.DIR_LEFT_TO_RIGHT, Layout.DIRS_ALL_LEFT_TO_RIGHT, false, null); if (text instanceof PrecomputedText) { PrecomputedText mt = (PrecomputedText) text; // Reaching here means there is only one paragraph. MeasuredParagraph mp = mt.getMeasuredParagraph(0); fm.width = (int) Math.ceil(mp.getWidth(0, mp.getTextLength())); } else { fm.width = (int) Math.ceil(line.metrics(fm)); } TextLine.recycle(line); return fm; Loading
core/java/android/text/TextLine.java +5 −0 Original line number Diff line number Diff line Loading @@ -172,7 +172,12 @@ public class TextLine { mComputed = null; if (text instanceof PrecomputedText) { // Here, no need to check line break strategy or hyphenation frequency since there is no // line break concept here. mComputed = (PrecomputedText) text; if (!mComputed.getParams().getTextPaint().equalsForTextMeasurement(paint)) { mComputed = null; } } mCharsValid = hasReplacement || hasTabs || directions != Layout.DIRS_ALL_LEFT_TO_RIGHT; Loading