From a554a78015cb8bd0b9f1e65a4ac478b42f73f5f9 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 08 三月 2024 16:04:45 +0800 Subject: [PATCH] # --- zy-asrs-flow/src/pages/map/utils.js | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js index c2d7558..c01b8d8 100644 --- a/zy-asrs-flow/src/pages/map/utils.js +++ b/zy-asrs-flow/src/pages/map/utils.js @@ -24,11 +24,13 @@ } } -export const initSprite = (sprite) => { +export const initSprite = (sprite, type) => { sprite.anchor.set(0.5); sprite.cursor = 'pointer'; sprite.eventMode = 'static'; - sprite.data = {}; + sprite.data = { + type: type + }; } // sprite be movable from sprite click event @@ -150,21 +152,21 @@ export const showSelectedEffect = (sprite) => { const { width, height } = sprite; - const scale = mapContainer.scale.x; + const scale = sprite.scale.x; const sideLen = (Math.max(width, height) + 10) * scale; const color = 0x273c75; effectHalfCircle = new PIXI.Graphics(); effectHalfCircle.beginFill(color); - effectHalfCircle.lineStyle(2, color); + effectHalfCircle.lineStyle(2 * scale, color); effectHalfCircle.arc(0, 0, sideLen, 0, Math.PI); effectHalfCircle.endFill(); effectHalfCircle.position.set(sprite.x, sprite.y); effectHalfCircle.scale.set(1 / scale); effectRectangle = new PIXI.Graphics(); - effectRectangle.lineStyle(2, color, 1); - effectRectangle.drawRoundedRect(0, 0, sideLen, sideLen, 16); + effectRectangle.lineStyle(2 * scale, color, 1); + effectRectangle.drawRoundedRect(0, 0, sideLen, sideLen, 16 * scale); effectRectangle.endFill(); effectRectangle.mask = effectHalfCircle; -- Gitblit v1.9.1