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

Commit 3880e093 authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

Update targetRect when font axes change

Bug: 376719456
Test: Manually checked clock picker preview
Flag: com.android.systemui.clock_reactive_variants
Change-Id: Icfba943f0b60e40ee54fff8892f6ca90d61e977c
parent 744b7fed
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -148,6 +148,10 @@ open class SimpleDigitalClockTextView(
        lsFontVariation = ClockFontAxisSetting.toFVar(axes + OPTICAL_SIZE_AXIS)
        lockScreenPaint.typeface = typefaceCache.getTypefaceForVariant(lsFontVariation)
        typeface = lockScreenPaint.typeface

        lockScreenPaint.getTextBounds(text, 0, text.length, textBounds)
        targetTextBounds.set(textBounds)

        textAnimator.setTextStyle(fvar = lsFontVariation, animate = false)
        measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED)
        recomputeMaxSingleDigitSizes()
@@ -201,7 +205,7 @@ open class SimpleDigitalClockTextView(
                    } else {
                        textBounds.height() + 2 * lockScreenPaint.strokeWidth.toInt()
                    },
                    MeasureSpec.getMode(measuredHeight),
                    MeasureSpec.getMode(measuredHeightAndState),
                )
        }

@@ -215,10 +219,10 @@ open class SimpleDigitalClockTextView(
                    } else {
                        max(
                            textBounds.width() + 2 * lockScreenPaint.strokeWidth.toInt(),
                            MeasureSpec.getSize(measuredWidth),
                            MeasureSpec.getSize(measuredWidthAndState),
                        )
                    },
                    MeasureSpec.getMode(measuredWidth),
                    MeasureSpec.getMode(measuredWidthAndState),
                )
        }