From be2e55aea250c9b863748658e85b9d4c417ff0cd Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Fri, 30 Oct 2020 19:47:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96fillBoldText?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/ui.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/ui.js b/libs/ui.js index 57085451..2a8c5b19 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -138,11 +138,9 @@ ui.prototype.fillBoldText = function (name, text, x, y, style, strokeStyle, font style = core.arrayToRGBA(style); if (!strokeStyle) strokeStyle = '#000000'; strokeStyle = core.arrayToRGBA(strokeStyle); - ctx.fillStyle = strokeStyle; - ctx.fillText(text, x-1, y-1); - ctx.fillText(text, x-1, y+1); - ctx.fillText(text, x+1, y-1); - ctx.fillText(text, x+1, y+1); + ctx.strokeStyle = strokeStyle; + ctx.lineWidth = 3; + ctx.strokeText(text, x, y); ctx.fillStyle = style; ctx.fillText(text, x, y); }