From 669f2bf90855f9f52b96a52546b4d9d7525a9db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com> Date: Fri, 28 Nov 2025 17:10:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BA=BF=E5=BD=93=E9=80=9F?= =?UTF-8?q?=E5=BA=A6=E4=B8=BA0=E6=97=B6=E4=B8=8D=E5=8F=8D=E5=90=91bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Tools/index.js b/src/Tools/index.js index 3544176..77f2a5a 100644 --- a/src/Tools/index.js +++ b/src/Tools/index.js @@ -709,7 +709,8 @@ class Tools { color: color, image: this.getSourceRootPath() + `/img/arrow/${type - 6}.png`, space: newParam.space, - speed: newParam.speed + speed: newParam.speed, + rotate: newParam.rotate } param.speed = newParam.rotate ? param.speed : 0 - param.speed @@ -733,11 +734,11 @@ class Tools { myImg.src = options.image myImg.onload = function () { options.space = Math.max(0.1, options.space); - if (options.speed > 0 || options.speed == 0) { + if (options.speed > 0 || (options.speed == 0 && options.rotate)) { canvasEle.width = myImg.width * (options.space + 1) canvasEle.height = myImg.height ctx.drawImage(myImg, myImg.width * (options.space / 2), 0) - } else { + } else if (options.speed < 0 || (options.speed == 0 && !options.rotate)) { ctx.clearRect(0, 0, canvasEle.width, canvasEle.height); canvasEle.width = myImg.width * (options.space + 1) canvasEle.height = myImg.height