From ff1c66540cb13a727197c91559015f30b11be146 Mon Sep 17 00:00:00 2001 From: Shua-github Date: Mon, 30 Dec 2024 22:19:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9B=B2=E5=BA=A6=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=A7=BB=E9=99=A4=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=E5=A4=A7=E5=B0=8F=E8=AE=BE=E7=BD=AE=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=9B=B8=E5=85=B3=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.jsx | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 5b79ea6..7567ac1 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -51,9 +51,10 @@ function App() { y: characters[character].defaultText.y, }); const [fontSize, setFontSize] = useState(characters[character].defaultText.s); - const [spaceSize, setSpaceSize] = useState(50); + const [spaceSize] = useState(50); const [rotate, setRotate] = useState(characters[character].defaultText.r); const [curve, setCurve] = useState(false); + const [curveAmount, setCurveAmount] = useState(0.15); // 新增曲度控制变量 const [loaded, setLoaded] = useState(false); const img = new Image(); @@ -108,13 +109,13 @@ function App() { if (curve) { ctx.save(); for (let line of lines) { - let lineAngle = (Math.PI * line.length) / 7; + let lineAngle = (Math.PI * line.length) * curveAmount; // 使用曲度变量 for (let pass = 0; pass < 2; pass++) { ctx.save(); for (let i = 0; i < line.length; i++) { - ctx.rotate(lineAngle / line.length / 2.2); + ctx.rotate(lineAngle / line.length / 2); ctx.save(); - ctx.translate(0, -1 * fontSize * 3.5); + ctx.translate(0, -1 * fontSize * 4); if (pass === 0) { ctx.strokeStyle = "white"; ctx.lineWidth = 15; @@ -258,20 +259,6 @@ function App() { color="secondary" /> -
- - setSpaceSize(v)} - min={0} - max={100} - step={1} - track={false} - color="secondary" - /> -
+
+ + setCurveAmount(v)} + min={0.05} + max={0.5} + step={0.01} + track={false} + color="secondary" + /> +