Add line style selection dropdown to tools panel for drawing new lines #1142
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
State Management:
selectedLineStylefield toRuntimeStatewith default valueLineStyleType.SingleColorsetSelectedLineStyleaction to update the selected line styleLine Creation Logic:
svg-canvas-graph.tsxto use the selected line style instead of hardcodedSingleColorSingleColorto preserve existing theme functionalityLine Style Component Updates:
newLineprop correctlynewLineistrue, components setpointer-events: nonesoelementsFromPointreturns the underlying station instead of the line during creationsingle-color,dual-color,river,shmetro-virtual-int,china-railway,bjsubway-single-color,bjsubway-dottedInternationalization:
Usage
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.comnpm install(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.