From 69586b3f09c759effb43aa5afa2180c8494c8c5a Mon Sep 17 00:00:00 2001 From: Modder4869 <28317935+Modder4869@users.noreply.github.com> Date: Wed, 12 Oct 2022 11:52:20 +0300 Subject: [PATCH] add more stickers --- src/App.jsx | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index b4e31ab..fe01cc6 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -18,6 +18,7 @@ function App() { y: characters[character].defaultText.y, }); const [fontSize, setFontSize] = useState(characters[character].defaultText.s); + const [spaceSize, setSpaceSize] = useState(1); const [rotate, setRotate] = useState(characters[character].defaultText.r); const [curve, setCurve] = useState(false); const [loaded, setLoaded] = useState(false); @@ -57,20 +58,26 @@ function App() { ctx.textAlign = "center"; ctx.strokeStyle = "white"; ctx.fillStyle = characters[character].color; - + var lines = text.split('\n'); if (curve) { - for (let i = 0; i < text.length; i++) { - ctx.rotate(angle / text.length / 2.5); + for (let line of lines){ + for (let i = 0; i < line.length; i++) { + ctx.rotate(angle / line.length / 2.5); ctx.save(); ctx.translate(0, -1 * fontSize * 3.5); - ctx.strokeText(text[i], 0, 0); - ctx.fillText(text[i], 0, 0); + ctx.strokeText(line[i], 0, 0); + ctx.fillText(line[i], 0, 0); ctx.restore(); } + } } else { - ctx.strokeText(text, 0, 0); - ctx.fillText(text, 0, 0); - ctx.restore(); + for (var i = 0,k=0; i +
+ + setSpaceSize(v)} + min={1} + max={100} + step={1} + track={false} + color="secondary" + /> +
setText(e.target.value)} />