From 37921583eafff4a9cbad44c096dba516a1229d1f Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 05 三月 2024 17:23:01 +0800 Subject: [PATCH] # --- zy-asrs-flow/src/pages/map/utils.js | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js index ace7582..c7bb455 100644 --- a/zy-asrs-flow/src/pages/map/utils.js +++ b/zy-asrs-flow/src/pages/map/utils.js @@ -64,4 +64,22 @@ } } +} + +export const isSpriteInSelectionBox = (sprite, selectionBox) => { + const spriteBounds = sprite.getBounds(); + const boxBounds = selectionBox.getBounds(); + + return spriteBounds.x + spriteBounds.width > boxBounds.x + && spriteBounds.x < boxBounds.x + boxBounds.width + && spriteBounds.y + spriteBounds.height > boxBounds.y + && spriteBounds.y < boxBounds.y + boxBounds.height; +} + +export const markSprite = (sprite) => { + sprite.alpha = 0.5; +} + +export const unMarkSprite = (sprite) => { + sprite.alpha = 1; } \ No newline at end of file -- Gitblit v1.9.1