From 19e24b4f23cf19fb2edf776abffa5b7e754c22d5 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 21 三月 2024 14:41:10 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/player.js | 25 ++++++++++---------------
1 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/player.js b/zy-asrs-flow/src/pages/map/player.js
index ec4d923..21b6729 100644
--- a/zy-asrs-flow/src/pages/map/player.js
+++ b/zy-asrs-flow/src/pages/map/player.js
@@ -25,7 +25,7 @@
this.getStartedTicker();
}
- activateMapEvent = (leftEvent, rightEvent) => {
+ activateMapEvent = (eventType, mapModel) => {
if (this.mapEvent) {
this.mapContainer.parent.off('mousedown');
this.mapEvent = null;
@@ -36,17 +36,11 @@
}
}
this.mapEvent = (event) => {
- if (leftEvent && event.button === 0) {
- switch (leftEvent) {
+ if (eventType && event.button === 0) {
+ switch (eventType) {
case Utils.MapEvent.SELECTION_BOX:
- this.mapSelect(event);
+ this.mapSelect(event, mapModel);
break
- default:
- break
- }
- }
- if (rightEvent && event.button === 2) {
- switch (rightEvent) {
default:
break
}
@@ -55,7 +49,7 @@
this.mapContainer.parent.on('mousedown', this.mapEvent)
}
- mapSelect = (event) => {
+ mapSelect = (event, mapModel) => {
let isSelecting = false;
if (!this.selectionBox) {
this.selectionBox = new PIXI.Graphics();
@@ -110,7 +104,7 @@
// sprites batch move
Utils.spriteListBeMovable(this.selectedSprites, this.scale, () => {
- this.activateMapEvent(Utils.MapEvent.SELECTION_BOX);
+ this.activateMapEvent(Utils.MapEvent.SELECTION_BOX, mapModel);
});
}
@@ -179,7 +173,7 @@
showCoordinates = () => {
const coordinatesText = new PIXI.Text('{ x: 0, y: 0 }', {
- fill: 0x000000,
+ fill: this.darkModel ? 0xffffff : 0x000000,
fontSize: 13,
fontFamily: 'MicrosoftYaHei',
fontWeight: 'bold',
@@ -197,6 +191,7 @@
}
showGridlines = () => {
+ this.hideGridlines();
if (!this.gridLineContainer) {
this.gridLineContainer = generatePixiContainer('gridLineContainer');
this.app.stage.addChild(this.gridLineContainer);
@@ -328,7 +323,7 @@
if (!this.mapContainer || !this.app) {
return;
}
-
+
this.mapContainer.scale.set(1);
this.mapContainer.position.set(0, 0);
if (this.mapContainer.children.length === 0) {
@@ -383,7 +378,7 @@
function generatePixiApp(dark) {
const app = new PIXI.Application({
- background: dark ? '#f1f2f6' : '#f1f2f6',
+ background: dark ? '#2f3542' : '#f1f2f6',
antialias: true,
})
app.stage.eventMode = 'static';
--
Gitblit v1.9.1