fix(web): 修复重构导致 allStations 变量未定义引发的渲染崩溃问题
This commit is contained in:
+3
-1
@@ -324,7 +324,9 @@
|
||||
`;
|
||||
}
|
||||
|
||||
const width = Math.max(560, Math.max(...allStations.map(c => stationXByCanonical[stationCanonicalByCode[c] || c] || 0)) + 120);
|
||||
const allX = Object.values(stationXByCanonical);
|
||||
const maxX = allX.length > 0 ? Math.max(...allX) : 0;
|
||||
const width = Math.max(560, maxX + 120);
|
||||
const height = Math.max(260, baseY + currentLineIdx * lineGapY + 60);
|
||||
mapContainer.innerHTML = `<svg width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">${svgContent}</svg>`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user