diff --git a/package-lock.json b/package-lock.json index 44a82e29..32987b05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@railmapgen/rmg-palette-resources": "^2.2.4", "@railmapgen/rmg-runtime": "^10.2.0", "@railmapgen/rmg-translate": "^3.2.3", - "@railmapgen/svg-assets": "^5.0.6", + "@railmapgen/svg-assets": "^5.0.8", "@reduxjs/toolkit": "^2.2.5", "bezier-js": "^6.1.4", "canvas-size": "^2.0.0", @@ -3583,9 +3583,9 @@ "license": "GPL-3.0-only" }, "node_modules/@railmapgen/svg-assets": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@railmapgen/svg-assets/-/svg-assets-5.0.6.tgz", - "integrity": "sha512-VI4JXsJqT8BmbF0FHrEzNLSqlyOQMNLKs3UIXQ+o/lR5p3YFTm0SjZXeJ0ZQteY1vWpk86UQzHLlLgNqZe7eXA==" + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@railmapgen/svg-assets/-/svg-assets-5.0.8.tgz", + "integrity": "sha512-1By8TzmsGAEkt5f1xfICJ999oe4mXXPWrz9+0H80QgEcst+8g1ux2Aet3QCoLvU8XTBojuE1AiutqCUk6rdeGg==" }, "node_modules/@reduxjs/toolkit": { "version": "2.2.6", diff --git a/package.json b/package.json index 4da550d1..82e0325e 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@railmapgen/rmg-palette-resources": "^2.2.4", "@railmapgen/rmg-runtime": "^10.2.0", "@railmapgen/rmg-translate": "^3.2.3", - "@railmapgen/svg-assets": "^5.0.6", + "@railmapgen/svg-assets": "^5.0.8", "@reduxjs/toolkit": "^2.2.5", "bezier-js": "^6.1.4", "canvas-size": "^2.0.0", diff --git a/src/components/svgs/stations/gzmtr-int-2024.tsx b/src/components/svgs/stations/gzmtr-int-2024.tsx index 7c4e5f67..2d242c54 100644 --- a/src/components/svgs/stations/gzmtr-int-2024.tsx +++ b/src/components/svgs/stations/gzmtr-int-2024.tsx @@ -60,7 +60,14 @@ const GzmtrInt2024Station = (props: StationComponentProps) => { ); const transferAll = transfer.flat().slice(0, 5); // slice to make sure at most 5 transfers + const stations = transferAll.map(s => ({ + style: (s[6] === 'gz' ? 'gzmtr' : 'fmetro') as 'gzmtr' | 'fmetro', + lineNum: s[4], + stnNum: s[5], + strokeColour: s[2], + })); + // use imperative handle to get the bbox of the icon (with the help from InterchangeStation2024Handle) const [borderBox, setBorderBox] = React.useState(); const [translate, setTranslate] = React.useState([0, 0]); const ref = React.useRef(null); @@ -85,17 +92,6 @@ const GzmtrInt2024Station = (props: StationComponentProps) => { document.fonts.load('12px Arial', 'ABCDEFG123456').finally(() => setTimeout(update, 100)); }, []); - // temporary fix for the missing id on the top element of the station - const iconEl = React.useRef(null); - iconEl.current?.querySelectorAll('path')?.forEach(elem => elem.setAttribute('id', `stn_core_${id}`)); - - const stations = transferAll.map(s => ({ - style: (s[6] === 'gz' ? 'gzmtr' : 'fmetro') as 'gzmtr' | 'fmetro', - lineNum: s[4], - stnNum: s[5], - strokeColour: s[2], - })); - const textX = (nameOffsetX === 'left' ? iconBBox.x1 : nameOffsetX === 'right' ? iconBBox.x2 : 0) * SCALE_WITH_PADDING; const textY = @@ -128,14 +124,7 @@ const GzmtrInt2024Station = (props: StationComponentProps) => { return ( - + { : undefined } /> + {/* Below is an overlay element that has all event hooks but can not be seen. */} +