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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JW57Zw8fvgzpeDkbUYT7sG
This commit is contained in:
2026-11-20 15:55:55 +00:00
co-authored by Claude Sonnet 5.5
parent eab5a47495
commit 7ffd3c5e22
+3 -3
View File
@@ -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)
}