commit 2e18642b515069ad1fa1bd45983813ef2716c43b
parent f3f662df7d613952b0d29260bd7b18eb1c6c48b4
Author: Yureka <yuka@yuka.dev>
Date: Wed, 2 Feb 2022 14:15:48 +0100
parent f3f662df7d613952b0d29260bd7b18eb1c6c48b4
Author: Yureka <yuka@yuka.dev>
Date: Wed, 2 Feb 2022 14:15:48 +0100
fix canvas crash
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/client/src/canvas.js b/client/src/canvas.js @@ -97,10 +97,8 @@ const addTextToCache = (text, color, fixedHeight) => { ctx.font = `${height}px sans-serif`; ctx.fillStyle = color; - if (height > 10) { - ctx.fillText(text, 0, height); - textCache[text] = canvas; - } + ctx.fillText(text, 0, height); + textCache[text] = canvas; }; const updateTextCache = () => {