From 2d36c9a2951ded9f74dcc1c7a37eaca86bc40591 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期一, 18 十二月 2023 16:36:48 +0800 Subject: [PATCH] #map latest test --- src/main/webapp/views/console4.html | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/views/console4.html b/src/main/webapp/views/console4.html index 15f29b4..1347f85 100644 --- a/src/main/webapp/views/console4.html +++ b/src/main/webapp/views/console4.html @@ -249,8 +249,8 @@ const shuttle = new PIXI.Sprite(resources.shuttle.texture); shuttle.width = width shuttle.height = height - shuttle.x = item.wcsPoint.y * width;//鏇存柊鍧愭爣x - shuttle.y = item.wcsPoint.x * height;//鏇存柊鍧愭爣y + shuttle.x = item.wcsPoint.x * width;//鏇存柊鍧愭爣x + shuttle.y = item.wcsPoint.y * height;//鏇存柊鍧愭爣y shuttle.updateMoveStatus = true;//鍔ㄧ敾鎵ц瀹屾垚 shuttle.interactive = true; // 蹇呴』瑕佽缃墠鑳芥帴鏀朵簨浠� shuttle.buttonMode = true; // 璁╁厜鏍囧湪hover鏃跺彉涓烘墜鍨嬫寚閽� @@ -655,11 +655,11 @@ if (shuttle.updateMoveStatus) {//鍔ㄧ敾鎵ц瀹屾垚鎵嶅彲缁х画鎵ц鍔ㄧ敾 shuttle.updateMoveStatus = false;//鍔ㄧ敾鎵ц涓� // 璁$畻涓ょ偣涔嬮棿鐨勮窛绂�1 - const distance = Math.sqrt(Math.pow((item.point.x * width) - shuttle.x, 2) + Math.pow((item.point.y * height) - shuttle.y, 2)); + const distance = Math.sqrt(Math.pow((item.wcsPoint.x * width) - shuttle.x, 2) + Math.pow((item.wcsPoint.y * height) - shuttle.y, 2)); gsap.killTweensOf(shuttle); // 鏉�姝绘墍鏈夐拡瀵�".class"鐨勫姩鐢� gsap.to(shuttle, { - x: item.point.x * width, // 鐩爣浣嶇疆 - y: item.point.y * height, // 鐩爣浣嶇疆 + x: item.wcsPoint.x * width, // 鐩爣浣嶇疆 + y: item.wcsPoint.y * height, // 鐩爣浣嶇疆 duration: distance / 100, // 鍔ㄧ敾鎸佺画鏃堕棿锛堢锛� ease: "power1.inOut", // 缂撳姩绫诲瀷 onComplete: () => { -- Gitblit v1.9.1