fix: 统一不同线路的地图容器大小,无论站点多少,容器最小宽度都保持一致
This commit is contained in:
+2
-2
@@ -208,7 +208,7 @@
|
||||
svgContent += renderStationNode(pts[i].x, pts[i].y, pts[i].code, i, li.color);
|
||||
}
|
||||
|
||||
const width = startX + pts.length * gapX + 40;
|
||||
const width = Math.max(container.clientWidth || 800, startX + pts.length * gapX + 40);
|
||||
const height = 120;
|
||||
// 添加 tvm-animate 类实现动画过渡
|
||||
container.innerHTML = `<svg class="tvm-animate" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" style="display:block;">${svgContent}</svg>`;
|
||||
@@ -288,7 +288,7 @@
|
||||
svgContent += renderStationNode(startX + i * gapX, y, routeCodes[i], i);
|
||||
}
|
||||
|
||||
const width = startX + routeCodes.length * gapX + 40;
|
||||
const width = Math.max(container.clientWidth || 800, startX + routeCodes.length * gapX + 40);
|
||||
const height = 120;
|
||||
container.innerHTML = `<svg class="tvm-animate" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" style="display:block;">${svgContent}</svg>`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user