Skip to content

Commit 689aa5f

Browse files
authoredFeb 7, 2025
zoneSymbol positioning fix (#115)
1 parent 4ef2d65 commit 689aa5f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed
 

‎src/components/routeMap/routeMap.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,16 @@ const RouteMap = (props) => {
188188
))}
189189
{projectedSymbols &&
190190
projectedSymbols.length > 0 &&
191-
projectedSymbols.map((symbol, index) => (
192-
<ItemFixed key={index} left={symbol.sy} top={symbol.sx}>
193-
<ZoneSymbol size={symbol.size} zone={symbol.zone} />
194-
</ItemFixed>
195-
))}
191+
projectedSymbols.map((symbol, index) => {
192+
const matchValues = symbol.size.match(/\d+/);
193+
const symbolSizeNumber = matchValues ? parseInt(matchValues[0], 10) : null;
194+
const offset = symbolSizeNumber ? symbolSizeNumber / 2 : 0;
195+
return (
196+
<ItemFixed key={index} left={symbol.sy - offset} top={symbol.sx - offset}>
197+
<ZoneSymbol size={symbol.size} zone={symbol.zone} />
198+
</ItemFixed>
199+
);
200+
})}
196201
{props.projectedTerminuses.map((terminus, index) => (
197202
<ItemPositioned
198203
key={index}

0 commit comments

Comments
 (0)