Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0903665f authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Fills font metrics before passing to ReplacementSpan

Bug: 74518333
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest
    Change-Id: Ifbc8625882919e6498a2758433e80f059a797fd4

Change-Id: I6181fd712aae38e0bba702374e01a40ee3b522dd
parent 7790a2f2
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -540,9 +540,6 @@ public class MeasuredParagraph {
    private void applyStyleRun(@IntRange(from = 0) int start,  // inclusive, in copied buffer
                               @IntRange(from = 0) int end,  // exclusive, in copied buffer
                               /* Maybe Zero */ long nativeBuilderPtr) {
        if (nativeBuilderPtr != 0) {
            mCachedPaint.getFontMetricsInt(mCachedFm);
        }

        if (mLtrWithoutBidi) {
            // If the whole text is LTR direction, just apply whole region.
@@ -614,6 +611,10 @@ public class MeasuredParagraph {
        final int startInCopiedBuffer = start - mTextStart;
        final int endInCopiedBuffer = end - mTextStart;

        if (nativeBuilderPtr != 0) {
            mCachedPaint.getFontMetricsInt(mCachedFm);
        }

        if (replacement != null) {
            applyReplacementRun(replacement, startInCopiedBuffer, endInCopiedBuffer,
                                nativeBuilderPtr);