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

Commit 98d29b44 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android (Google) Code Review
Browse files

Merge "Follow up to TextView's baseline is correctly computed for empty text"

parents 00ac96b8 850dffa0
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -706,9 +706,19 @@ class TextLine {
            Canvas c, float x, int top, int y, int bottom,
            FontMetricsInt fmi, boolean needWidth) {

        float ret = 0;
        // Get metrics first (even for empty strings or "0" width runs)
        if (fmi != null) {
            expandMetricsFromPaint(fmi, wp);
        }

        int runLen = end - start;
        // No need to do anything if the run width is "0"
        if (runLen == 0) {
            return 0f;
        }

        float ret = 0;

        int contextLen = contextEnd - contextStart;
        if (needWidth || (c != null && (wp.bgColor != 0 || runIsRtl))) {
            int flags = runIsRtl ? Paint.DIRECTION_RTL : Paint.DIRECTION_LTR;
@@ -723,10 +733,6 @@ class TextLine {
            }
        }

        if (fmi != null) {
            expandMetricsFromPaint(fmi, wp);
        }

        if (c != null) {
            if (runIsRtl) {
                x -= ret;