From bcaa1de4805147e8d0962d0bf5465bb0abcd9a99 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 21 三月 2024 09:52:58 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/player.js | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/player.js b/zy-asrs-flow/src/pages/map/player.js
index fcd26a5..fe71ddf 100644
--- a/zy-asrs-flow/src/pages/map/player.js
+++ b/zy-asrs-flow/src/pages/map/player.js
@@ -149,6 +149,9 @@
this.scale = 1;
this.app.view.addEventListener('wheel', (event) => {
event.preventDefault();
+ if (this.scale !== this.mapContainer.scale.x) {
+ this.scale = this.mapContainer.scale.x;
+ }
const delta = Math.sign(event.deltaY);
@@ -176,7 +179,7 @@
showCoordinates = () => {
const coordinatesText = new PIXI.Text('{ x: 0, y: 0 }', {
- fill: 0x000000,
+ fill: this.darkModel ? 0xffffff : 0x000000,
fontSize: 13,
fontFamily: 'MicrosoftYaHei',
fontWeight: 'bold',
@@ -194,17 +197,18 @@
}
showGridlines = () => {
+ this.hideGridlines();
if (!this.gridLineContainer) {
this.gridLineContainer = generatePixiContainer('gridLineContainer');
this.app.stage.addChild(this.gridLineContainer);
}
const inte = 30;
- const lineDefaultAlpha = .5;;
+ const lineDefaultAlpha = .1;;
const lineDefaultColor = 0x000000;
for (let i = 0; i < this.app.view.width / inte; i++) {
const graphics = new PIXI.Graphics();
- graphics.lineStyle(.3, lineDefaultColor, lineDefaultAlpha);
+ graphics.lineStyle(1, lineDefaultColor, lineDefaultAlpha);
graphics.beginFill(lineDefaultColor);
graphics.moveTo(i * inte, 0);
graphics.lineTo(i * inte, this.app.view.height);
@@ -214,7 +218,7 @@
for (let i = 0; i < this.app.view.height / inte; i++) {
const graphics = new PIXI.Graphics();
- graphics.lineStyle(.3, lineDefaultColor, lineDefaultAlpha);
+ graphics.lineStyle(1, lineDefaultColor, lineDefaultAlpha);
graphics.beginFill(lineDefaultColor);
graphics.moveTo(0, i * inte);
graphics.lineTo(this.app.view.width, i * inte);
@@ -325,11 +329,12 @@
if (!this.mapContainer || !this.app) {
return;
}
+
+ this.mapContainer.scale.set(1);
+ this.mapContainer.position.set(0, 0);
if (this.mapContainer.children.length === 0) {
return;
}
- this.mapContainer.scale.set(1);
- this.mapContainer.position.set(0, 0);
let minX, maxX, minY, maxY;
for (let sprite of this.mapContainer.children) {
@@ -379,7 +384,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