#
vincentlu
2025-12-17 3c1abee642f41aed290d4b6873a3fcabbed850d4
#
2个文件已修改
10 ■■■■■ 已修改文件
zy-acs-flow/src/map/AreaList.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/tool.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/AreaList.jsx
@@ -49,7 +49,7 @@
        }
        const sprite = Tool.findAreaSpriteById(area.id);
        if (sprite) {
            Tool.focusAreaSprite(sprite);
            Tool.focusAreaSprite(sprite, 570);
            onClose();
            setCurSprite(sprite);
        }
zy-acs-flow/src/map/tool.js
@@ -1159,7 +1159,7 @@
    setShowAreas(false);
};
export const focusAreaSprite = (sprite) => {
export const focusAreaSprite = (sprite, rightPanelWidth) => {
    if (!sprite || !app || !mapContainer) {
        return;
    }
@@ -1176,9 +1176,10 @@
    const paddedHeight = (height || 1000) * 1.25;
    const viewportWidth = app.renderer.width || 1920;
    const viewportHeight = app.renderer.height || 1080;
    const effectiveViewportWidth = Math.max(1, viewportWidth - rightPanelWidth);
    let focusScale = Math.min(
        (viewportWidth * 0.65) / paddedWidth,
        (effectiveViewportWidth * 0.65) / paddedWidth,
        (viewportHeight * 0.65) / paddedHeight
    );
    focusScale = Math.min(Math.max(focusScale, 0.03), 0.25);
@@ -1189,9 +1190,10 @@
    const bounds = sprite.getBounds();
    const centerX = bounds.x + bounds.width / 2;
    const centerY = bounds.y + bounds.height / 2;
    const visibleCenterX = (viewportWidth - rightPanelWidth) / 2;
    const targetPos = {
        x: viewportWidth / 2 - centerX,
        x: visibleCenterX - centerX,
        y: viewportHeight / 2 - centerY,
    };