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

Commit 138497c4 authored by Ned Burns's avatar Ned Burns Committed by Android (Google) Code Review
Browse files

Merge "[SB][Battery] Protect against UnifiedBattery using too-big insets." into main

parents db07461e 4304e256
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -101,7 +101,13 @@ fun BatteryCanvas(
            for (glyph in glyphs) {
                // Move the glyph to the right spot
                val verticalOffset = (BatteryFrame.innerHeight - glyph.height) / 2
                inset(horizontalOffset, verticalOffset) { glyph.draw(this, colors) }
                inset(
                    // Never try and inset more than half of the available size - see b/400246091.
                    minOf(horizontalOffset, size.width / 2),
                    minOf(verticalOffset, size.height / 2),
                ) {
                    glyph.draw(this, colors)
                }

                horizontalOffset += glyph.width + INTER_GLYPH_PADDING_PX
            }