#
luxiaotao1123
2024-03-03 427fd48c0fcd2653e3309d6b544b5b516f7ff377
#
1个文件已修改
11 ■■■■■ 已修改文件
zy-asrs-flow/src/pages/map/player.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/player.js
@@ -5,7 +5,6 @@
    constructor(dom, dark) {
        this.darkModel = dark;
        // init
        this.app = generatePixiApp();
        dom.appendChild(this.app.view);
@@ -28,10 +27,8 @@
                this.mapPan(event);
            }
        })
        this.activateMapScale();
        this.showCoordinates();
        this.appTicker();
    }
@@ -45,9 +42,7 @@
            } else if (delta === -1) {
                this.scale *= 1.1;
            }
            this.mapContainer.scale.set(this.scale);
            this.mapContainer.children.forEach(child => {
                // child.scale.set(1 / this.scale); // 防止图标变小
            })
@@ -57,7 +52,6 @@
    mapPan = (event) => {
        this.pan = true;
        let previousPosition = { x: event.clientX, y: event.clientY };
        const mouseMoveHandler = (event) => {
            if (this.pan) {
                const dx = event.clientX - previousPosition.x;
@@ -69,14 +63,11 @@
                previousPosition = { x: event.clientX, y: event.clientY };
            }
        };
        this.app.view.addEventListener('mousemove', mouseMoveHandler);
        this.app.view.addEventListener('mouseup', () => {
            this.app.view.removeEventListener('mousemove', mouseMoveHandler);
            this.pan = false;
        });
    }
    showCoordinates = () => {
@@ -94,9 +85,7 @@
            const mouseY = (event.clientY - this.mapContainer.position.y) / this.scale;
            coordinatesText.text = `{ x: ${mouseX.toFixed(2)}, y: ${mouseY.toFixed(2)} }`;
        };
        this.app.view.addEventListener('mousemove', mouseMoveInfoTextHandler);
    }
    appTicker = () => {