rmp
rmp copied to clipboard
Add line style selection dropdown to tools panel for drawing new lines
Previously, users could only draw new lines using the single-color style, which was hardcoded in the line creation logic. This PR adds the ability to select from all available line styles when drawing new lines.
Changes Made
UI Enhancement:
- Added a "Line style" dropdown in the tools panel above the line path buttons
- Dropdown shows localized line style names using the existing localization system
- Only appears when the tools panel is expanded to maintain clean UI
State Management:
- Added
selectedLineStylefield toRuntimeStatewith default valueLineStyleType.SingleColor - Added
setSelectedLineStyleaction to update the selected line style - Selected line style persists until user changes it
Line Creation Logic:
- Modified
svg-canvas-graph.tsxto use the selected line style instead of hardcodedSingleColor - Special handling for
SingleColorto preserve existing theme functionality - Other line styles use their proper default attributes
Line Style Component Updates:
- Updated multiple line style components to handle the
newLineprop correctly - When
newLineistrue, components setpointer-events: nonesoelementsFromPointreturns the underlying station instead of the line during creation - Updated components:
single-color,dual-color,river,shmetro-virtual-int,china-railway,bjsubway-single-color,bjsubway-dotted
Internationalization:
- Added translations for "Line style" in English, Chinese Simplified, and Chinese Traditional
Usage
- Expand the tools panel
- Select desired line style from the "Line style" dropdown
- Choose a line path type (diagonal, perpendicular, etc.)
- Draw lines as usual - they will now use the selected line style
The selected line style remains active until changed, allowing users to draw multiple lines with the same style efficiently.
Fixes #1141.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
registry.npmmirror.com
- Triggering command:
npm install(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.