From 7ffd3c5e22986cb3f0fb68de9789a276502d1340 Mon Sep 17 00:00:00 2001 From: weishaupt <1+weishaupt@noreply.localhost> Date: Fri, 20 Nov 2026 15:55:55 +0000 Subject: [PATCH] MirrorBar Plus 11: fix clock font zone width so other fonts are centered The measured clock width was a fixed pixel count, so the supersampled drawing pass used a zone half as wide as it needed. It is now stored at 96 dpi and scaled with the bar. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01JW57Zw8fvgzpeDkbUYT7sG --- look.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/look.go b/look.go index d78ee24..998a86c 100644 --- a/look.go +++ b/look.go @@ -53,7 +53,7 @@ var ( clockFontIx = 0 chargeIx = 0 - clockMeasured int32 // the width the time and date need in a font other than Segoe UI + clockMeasured float64 // the width the time and date need in a font other than Segoe UI, at 96 dpi so it scales with the bar ) var logoStyleNames = []string{ @@ -176,7 +176,7 @@ func clockPx() int { // clockWidth is the room the time and date need, which grows with the text. func clockWidth() int32 { if clockFontIx > 0 && clockMeasured > 0 { - return clockMeasured + px(24) + return px(clockMeasured + 24) } w := 140.0 * float64(clockPx()) / 13.0 if clockBold { @@ -201,7 +201,7 @@ func rebuildClockFonts() { scale *= superSample fontTime2 = makeFontFace(face, px(float64(clockPx())), weight) scale /= superSample - clockMeasured = measureClockText() + clockMeasured = float64(measureClockText()) / scale if oldA != 0 { pDeleteObject.Call(oldA) }