From 31789df35cddf0db44bbaa66cdf5cdd8561e5a3b Mon Sep 17 00:00:00 2001 From: SuperDooper <37051355+superdooper86@users.noreply.github.com> Date: Fri, 8 May 2026 17:01:25 +0200 Subject: [PATCH] Fix gauge text centering (beta.33) --- windows/Controls/GaugeControl.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/windows/Controls/GaugeControl.cs b/windows/Controls/GaugeControl.cs index 8421d2c..af180db 100644 --- a/windows/Controls/GaugeControl.cs +++ b/windows/Controls/GaugeControl.cs @@ -56,17 +56,19 @@ public class GaugeControl : FrameworkElement CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface(new FontFamily("Segoe UI"), FontStyles.Normal, FontWeights.Bold, FontStretches.Normal), 14, new SolidColorBrush(textColor), dpi); - dc.DrawText(pctText, new Point(cx - pctText.Width / 2, cy - pctText.Height - 1)); - var sub = new FormattedText( - "Updated\nnow", + "used", CultureInfo.CurrentCulture, FlowDirection.LeftToRight, - new Typeface("Segoe UI"), 7, + new Typeface("Segoe UI"), 8, new SolidColorBrush(subColor), dpi) { TextAlignment = TextAlignment.Center }; - dc.DrawText(sub, new Point(cx - sub.Width / 2, cy + 2)); + + var totalHeight = pctText.Height + 2 + sub.Height; + var startY = cy - totalHeight / 2; + dc.DrawText(pctText, new Point(cx - pctText.Width / 2, startY)); + dc.DrawText(sub, new Point(cx - sub.Width / 2, startY + pctText.Height + 2)); } private static void DrawArc(DrawingContext dc, double cx, double cy, double r,