From 2e4caffde58da8a5c04b1f9756a306e7db9ff1ad Mon Sep 17 00:00:00 2001 From: wf0304-gme <452399386@qq.com> Date: Tue, 6 Dec 2022 17:39:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=BB=84=E4=BB=B6README=EF=BC=8C=E4=B8=8E=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JSUI/JSCanvasComponet/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/JSUI/JSCanvasComponet/README.md b/JSUI/JSCanvasComponet/README.md index ea44bb14..d94c2239 100644 --- a/JSUI/JSCanvasComponet/README.md +++ b/JSUI/JSCanvasComponet/README.md @@ -60,7 +60,7 @@ ``` draw() { // 将画布沿X、Y轴平移指定距离 - this.ctx.translate(this.centerX + 10, this.centerY); + this.ctx.translate(this.centerX + 20, this.centerY - this.padding * 1.3); // 画外部圆盘的花瓣 this.drawFlower(); // 画外部圆盘、小圈圈、五角星 @@ -303,8 +303,8 @@ draw() { const floatX = event.touches[0].globalX; const floatY = event.touches[0].globalY; const radius = this.centerX / 7 + this.padding / 2; - const isScopeX = this.centerX - radius < floatX && this.centerX + radius > floatX; - const isScopeY = this.centerY - radius < floatY && this.centerY + radius > floatY; + const isScopeX = this.centerX + 20 - radius < floatX && this.centerX + 20 + radius > floatX; + const isScopeY = this.centerY - this.padding * 1.3 - radius < floatY && this.centerY - this.padding * 1.3 + radius > floatY; if (isScopeX && isScopeY && this.playState !== 'running') { this.startAnimator(); } -- Gitee