From 9b247a8e766dc33ae27e0b90206f59256e5c24f4 Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Fri, 10 Apr 2026 12:25:23 +0200 Subject: [PATCH] center text in copilot Signed-off-by: Peter Siegmund --- plugin/actions/CopilotAction.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/actions/CopilotAction.js b/plugin/actions/CopilotAction.js index c5ebdcc..e744f23 100644 --- a/plugin/actions/CopilotAction.js +++ b/plugin/actions/CopilotAction.js @@ -105,14 +105,14 @@ class CopilotAction extends ActionBase { const color = pct <= 0.5 ? '#4caf50' : pct <= 0.8 ? '#ffeb3b' : '#f44336'; const displayText = value.toFixed(1) + '%'; - const fSize = displayText.length > 6 ? 28 : 34; + const fSize = displayText.length > 5 ? 28 : 34; ctx.fillStyle = color; ctx.font = `bold ${fSize}px "Source Han Sans SC"`; - ctx.fillText(displayText, cx, cy + 8); + ctx.fillText(displayText, cx, cy); } else { ctx.fillStyle = isError ? '#ff6b6b' : '#666666'; ctx.font = 'bold 28px "Source Han Sans SC"'; - ctx.fillText(isError ? 'ERR' : 'N/A', cx, cy + 8); + ctx.fillText(isError ? 'ERR' : 'N/A', cx, cy); } // Label — bottom