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

Commit 508f81fc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix top/bottom to adjust fallback ascent/descent."

parents 90413535 d2980207
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -874,6 +874,18 @@ public class StaticLayout extends Layout {
                            ? Math.max(fmDescent, Math.round(descents[breakIndex]))
                            : fmDescent;

                    // The fallback ascent/descent may be larger than top/bottom of the default font
                    // metrics. Adjust top/bottom with ascent/descent for avoiding unexpected
                    // clipping.
                    if (fallbackLineSpacing) {
                        if (ascent < fmTop) {
                            fmTop = ascent;
                        }
                        if (descent > fmBottom) {
                            fmBottom = descent;
                        }
                    }

                    v = out(source, here, endPos,
                            ascent, descent, fmTop, fmBottom,
                            v, spacingmult, spacingadd, chooseHt, chooseHtv, fm,