Skip to content

Commit 42a4a19

Browse files
committed
#979 Fix mis-align of chongqingrt int
1 parent b610ff4 commit 42a4a19

File tree

1 file changed

+81
-85
lines changed

1 file changed

+81
-85
lines changed

src/components/svgs/stations/chongqingrt-int.tsx

+81-85
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const LINE_HEIGHT = {
2323
bottom: 9 + 1,
2424
};
2525

26+
const SCALE = 2.5;
27+
const ORIGINAL_SIZE = 6.9233;
28+
2629
const ChongqingRTIntStation = (props: StationComponentProps) => {
2730
const { id, x, y, attrs, handlePointerDown, handlePointerMove, handlePointerUp } = props;
2831
const {
@@ -69,91 +72,84 @@ const ChongqingRTIntStation = (props: StationComponentProps) => {
6972
const textAnchor = nameOffsetX === 'left' ? 'end' : nameOffsetX === 'right' ? 'start' : 'middle';
7073

7174
return (
72-
<g id={id} transform={`translate(${x - 8}, ${y - 8})`}>
73-
<circle
74-
id={`stn_core_${id}`}
75-
cx="9"
76-
cy="9"
77-
r="9"
78-
stroke="black"
79-
strokeWidth="1"
80-
strokeOpacity="0"
81-
fill="white"
82-
fillOpacity="0"
83-
onPointerDown={onPointerDown}
84-
onPointerMove={onPointerMove}
85-
onPointerUp={onPointerUp}
86-
style={{ cursor: 'move' }}
87-
className="removeMe"
88-
/>
89-
<path
90-
style={{
91-
fill: 'white',
92-
stroke: '#231815',
93-
strokeMiterlimit: 22.9,
94-
strokeWidth: 0.232,
95-
transform: 'scale(2.5)',
96-
pointerEvents: 'none',
97-
}}
98-
d="M3.4614974.2162582c1.7925251,0,3.2455526,1.4530487,3.2455526,3.2453842,0,1.792366-1.4530275,3.2453995-3.2455526,3.2453995C1.6690944,6.7070418.21625,5.2540084.21625,3.4616424.21625,1.6693069,1.6690944.2162582,3.4614974.2162582Z"
99-
/>
100-
{transfer[0].length <= 2 ? (
101-
<>
102-
<path
103-
style={{
104-
fill: transfer[0][0] ? transfer[0][0][2] : 'gray',
105-
fillRule: 'evenodd',
106-
strokeWidth: 0,
107-
transform: 'scale(2.5)',
108-
pointerEvents: 'none',
109-
}}
110-
d="M1.0979448,3.8435012l1.1043701,1.5950012c.0114136.0164948.0303345.0263977.0505371.0263977.0200806,0,.0393677-.0102005.0500488-.0263977l1.1044312-1.5950012c.0125122-.0185013.0131226-.0417023.0014038-.0606995-.012085-.0190048-.0339966-.0295029-.0563965-.0271988h-.7849121v-1.3498993s-.0178223-.7273026.5388794-.9116058c-.4074097.0394058-.7789917.2495041-1.0224609.5786057-.0969238.1385956-.1479492.3043976-.1459961.4735947v1.2084045h-.7854004c-.0223999-.0025024-.0444946.0083008-.0563965.0271988-.0120239.0189972-.0114136.0430984.0016479.0613022l.0002441.0002975Z"
111-
/>
112-
<path
113-
style={{
114-
fill: transfer[0][1] ? transfer[0][1][2] : 'gray',
115-
fillRule: 'evenodd',
116-
strokeWidth: 0,
117-
transform: 'scale(2.5)',
118-
pointerEvents: 'none',
119-
}}
120-
d="M5.8267046,3.0806991l-1.1043701-1.5956955c-.0112915-.0167007-.0303345-.0266037-.050415-.0266037-.0202026,0-.0388794.0102005-.0498657.0266037l-1.1053467,1.5956955c-.0123901.0181046-.0126953.0419006-.0010986.0603027.012207.0189972.0339966.0294952.0563965.0271988h.7846069v1.3498993s.0187988.7276993-.538269.9113007c.4074097-.0391006.7789917-.2490997,1.0224609-.5782013.0975342-.1400986.1483154-.3050003.1459961-.4733963v-1.2008057h.7852173c.0231934-.0010986.0444946-.0135956.055481-.0330963.0114136-.0198975.0111084-.0439987-.0007935-.0632019Z"
121-
/>
122-
</>
123-
) : (
124-
<>
125-
<path
126-
style={{
127-
fill: transfer[0][0] ? transfer[0][0][2] : 'gray',
128-
fillRule: 'evenodd',
129-
strokeWidth: 0,
130-
transform: 'scale(2.5)',
131-
pointerEvents: 'none',
132-
}}
133-
d="M2.1100183,1.396341l-.7417603,1.481102c-.0080566.0152969-.0077515.033699.0004883.0487976.0083008.0149994.0235596.0249023.0405884.0263062l1.6477051.1731949c.0187988.0019989.0368652-.0073013.0459595-.0237961.0090332-.0167007.0079346-.0373993-.0028687-.053299l-.3220215-.5876007,1.0109253-.5536041s.5374146-.3120956.9033813.0295029c-.1964722-.2889023-.5062866-.481102-.852356-.5284042-.1449585-.0155945-.2894287.0139008-.4145508.0848007l-.8996619.4923019-.3211022-.5878983c-.010498-.0169983-.0286865-.0278015-.0479126-.0279999-.0192871-.0003052-.0372314.0098953-.046814.0265961"
134-
/>
135-
<path
136-
style={{
137-
fill: transfer[0][1] ? transfer[0][1][2] : 'gray',
138-
fillRule: 'evenodd',
139-
strokeWidth: 0,
140-
transform: 'scale(2.5)',
141-
pointerEvents: 'none',
142-
}}
143-
d="M2.1465752,5.5567532l1.6500854-.1408997c.017334-.0011063.0325928-.0110016.0411377-.0258026.0084839-.0149994.0090942-.0334015.001709-.0486984l-.7124023-1.4950027c-.0085449-.0169983-.0255127-.0271988-.0442505-.0267029-.0192871.0009003-.0362549.0125046-.0441895.0301056l-.333374.5811005-.9993896-.573204s-.5466309-.2956009-.4465332-.7859955c-.1436768.3182983-.1459961.6828003-.0056763,1.0028992.0614624.1306.1624756.2388992.2888794.3091965l.8948975.5130997-.3336792.5817032c-.0112915.0155945-.0126953.036499-.0036011.0534973.0089722.0167999.0272217.0267029.0458984.024704h.0004883Z"
144-
/>
145-
<path
146-
style={{
147-
fill: transfer[0][2] ? transfer[0][2][2] : 'gray',
148-
fillRule: 'evenodd',
149-
strokeWidth: 0,
150-
transform: 'scale(2.5)',
151-
pointerEvents: 'none',
152-
}}
153-
d="M5.7657089,3.4463346l-.9017334-1.3894958c-.0092773-.0147018-.0251465-.0234985-.0424805-.0241013-.0169678-.0006027-.0330811.0076981-.0430908.0214996l-.9835815,1.3335037c-.0112915.0149994-.012207.0354004-.0025024.0515976.0095825.0163956.0279541.0256958.0469971.0242996l.6698608.0202026-.0343018,1.1516953s-.0028687.6216049-.4827881.7641983c.3486938-.0233002.6713257-.1929932.8873291-.4676971.0866699-.1167984.1342773-.2565994.1365967-.4000015l.0305786-1.0246964.6697998.0200958c.0202026-.0005951.0386353-.010498.0485229-.0271988.0101929-.0163956.010498-.0371017.0007935-.0539017"
154-
/>
155-
</>
156-
)}
75+
<g id={id} transform={`translate(${x}, ${y})`}>
76+
<g transform={`translate(${(-ORIGINAL_SIZE * SCALE) / 2},${(-ORIGINAL_SIZE * SCALE) / 2})scale(${SCALE})`}>
77+
<path
78+
style={{
79+
fill: 'white',
80+
stroke: '#231815',
81+
strokeMiterlimit: 22.9,
82+
strokeWidth: 0.232,
83+
}}
84+
d="M3.4614974.2162582c1.7925251,0,3.2455526,1.4530487,3.2455526,3.2453842,0,1.792366-1.4530275,3.2453995-3.2455526,3.2453995C1.6690944,6.7070418.21625,5.2540084.21625,3.4616424.21625,1.6693069,1.6690944.2162582,3.4614974.2162582Z"
85+
/>
86+
{transfer[0].length <= 2 ? (
87+
<>
88+
<path
89+
style={{
90+
fill: transfer[0][0] ? transfer[0][0][2] : 'gray',
91+
fillRule: 'evenodd',
92+
strokeWidth: 0,
93+
}}
94+
d="M1.0979448,3.8435012l1.1043701,1.5950012c.0114136.0164948.0303345.0263977.0505371.0263977.0200806,0,.0393677-.0102005.0500488-.0263977l1.1044312-1.5950012c.0125122-.0185013.0131226-.0417023.0014038-.0606995-.012085-.0190048-.0339966-.0295029-.0563965-.0271988h-.7849121v-1.3498993s-.0178223-.7273026.5388794-.9116058c-.4074097.0394058-.7789917.2495041-1.0224609.5786057-.0969238.1385956-.1479492.3043976-.1459961.4735947v1.2084045h-.7854004c-.0223999-.0025024-.0444946.0083008-.0563965.0271988-.0120239.0189972-.0114136.0430984.0016479.0613022l.0002441.0002975Z"
95+
/>
96+
<path
97+
style={{
98+
fill: transfer[0][1] ? transfer[0][1][2] : 'gray',
99+
fillRule: 'evenodd',
100+
strokeWidth: 0,
101+
}}
102+
d="M5.8267046,3.0806991l-1.1043701-1.5956955c-.0112915-.0167007-.0303345-.0266037-.050415-.0266037-.0202026,0-.0388794.0102005-.0498657.0266037l-1.1053467,1.5956955c-.0123901.0181046-.0126953.0419006-.0010986.0603027.012207.0189972.0339966.0294952.0563965.0271988h.7846069v1.3498993s.0187988.7276993-.538269.9113007c.4074097-.0391006.7789917-.2490997,1.0224609-.5782013.0975342-.1400986.1483154-.3050003.1459961-.4733963v-1.2008057h.7852173c.0231934-.0010986.0444946-.0135956.055481-.0330963.0114136-.0198975.0111084-.0439987-.0007935-.0632019Z"
103+
/>
104+
</>
105+
) : (
106+
<>
107+
<path
108+
style={{
109+
fill: transfer[0][0] ? transfer[0][0][2] : 'gray',
110+
fillRule: 'evenodd',
111+
strokeWidth: 0,
112+
}}
113+
d="M2.1100183,1.396341l-.7417603,1.481102c-.0080566.0152969-.0077515.033699.0004883.0487976.0083008.0149994.0235596.0249023.0405884.0263062l1.6477051.1731949c.0187988.0019989.0368652-.0073013.0459595-.0237961.0090332-.0167007.0079346-.0373993-.0028687-.053299l-.3220215-.5876007,1.0109253-.5536041s.5374146-.3120956.9033813.0295029c-.1964722-.2889023-.5062866-.481102-.852356-.5284042-.1449585-.0155945-.2894287.0139008-.4145508.0848007l-.8996619.4923019-.3211022-.5878983c-.010498-.0169983-.0286865-.0278015-.0479126-.0279999-.0192871-.0003052-.0372314.0098953-.046814.0265961"
114+
/>
115+
<path
116+
style={{
117+
fill: transfer[0][1] ? transfer[0][1][2] : 'gray',
118+
fillRule: 'evenodd',
119+
strokeWidth: 0,
120+
}}
121+
d="M2.1465752,5.5567532l1.6500854-.1408997c.017334-.0011063.0325928-.0110016.0411377-.0258026.0084839-.0149994.0090942-.0334015.001709-.0486984l-.7124023-1.4950027c-.0085449-.0169983-.0255127-.0271988-.0442505-.0267029-.0192871.0009003-.0362549.0125046-.0441895.0301056l-.333374.5811005-.9993896-.573204s-.5466309-.2956009-.4465332-.7859955c-.1436768.3182983-.1459961.6828003-.0056763,1.0028992.0614624.1306.1624756.2388992.2888794.3091965l.8948975.5130997-.3336792.5817032c-.0112915.0155945-.0126953.036499-.0036011.0534973.0089722.0167999.0272217.0267029.0458984.024704h.0004883Z"
122+
/>
123+
<path
124+
style={{
125+
fill: transfer[0][2] ? transfer[0][2][2] : 'gray',
126+
fillRule: 'evenodd',
127+
strokeWidth: 0,
128+
}}
129+
d="M5.7657089,3.4463346l-.9017334-1.3894958c-.0092773-.0147018-.0251465-.0234985-.0424805-.0241013-.0169678-.0006027-.0330811.0076981-.0430908.0214996l-.9835815,1.3335037c-.0112915.0149994-.012207.0354004-.0025024.0515976.0095825.0163956.0279541.0256958.0469971.0242996l.6698608.0202026-.0343018,1.1516953s-.0028687.6216049-.4827881.7641983c.3486938-.0233002.6713257-.1929932.8873291-.4676971.0866699-.1167984.1342773-.2565994.1365967-.4000015l.0305786-1.0246964.6697998.0200958c.0202026-.0005951.0386353-.010498.0485229-.0271988.0101929-.0163956.010498-.0371017.0007935-.0539017"
130+
/>
131+
</>
132+
)}
133+
134+
{/* Below is an overlay element that has all event hooks but can not be seen. */}
135+
<path
136+
id={`stn_core_${id}`}
137+
style={{
138+
fill: 'white',
139+
fillOpacity: '0',
140+
stroke: '#231815',
141+
strokeMiterlimit: 22.9,
142+
strokeWidth: 0.232,
143+
strokeOpacity: 0,
144+
cursor: 'move',
145+
}}
146+
onPointerDown={onPointerDown}
147+
onPointerMove={onPointerMove}
148+
onPointerUp={onPointerUp}
149+
className="removeMe"
150+
d="M3.4614974.2162582c1.7925251,0,3.2455526,1.4530487,3.2455526,3.2453842,0,1.792366-1.4530275,3.2453995-3.2455526,3.2453995C1.6690944,6.7070418.21625,5.2540084.21625,3.4616424.21625,1.6693069,1.6690944.2162582,3.4614974.2162582Z"
151+
/>
152+
</g>
157153
<g transform={`translate(${textX}, ${textY})`} textAnchor={textAnchor}>
158154
<MultilineText
159155
text={names[0].split('\n')}

0 commit comments

Comments
 (0)