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) }