-
Notifications
You must be signed in to change notification settings - Fork 41
#497 Add glow effect for selected #1162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: thekingofcity <[email protected]>
…ply to pre/post components Co-authored-by: thekingofcity <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
langonginc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The horizontal and vertical lines will be disappeared when selected.
- Item in black will not be added with yellow effect.
Both were fixed :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a fluorescent yellow glow effect for selected elements (stations, misc nodes, and line styles) to provide visual feedback during selection. The implementation uses a centralized SVG filter approach that applies conditionally to selected elements without modifying individual component implementations.
Changes:
- Added SVG filter definition for selection glow effect with yellow color and blur
- Modified svg-layer.tsx to wrap all selected element components (pre, main, post) with the glow filter
- Updated svg-canvas-graph.tsx to pass selection state to SvgLayer component
- Added filter removal logic in download.ts to prevent glow effect in exported files
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/components/svg-wrapper.tsx | Added selected-glow SVG filter definition with yellow color matrix and blur effects |
| src/components/svg-layer.tsx | Wrapped all element components (lines, stations, misc-nodes) with conditional glow filter based on selection state; updated memoization to include selected prop |
| src/components/svg-canvas-graph.tsx | Passed selected Set to SvgLayer component |
| src/util/download.ts | Added logic to remove glow filter attribute from elements during export |
Implements a dynamic fluorescent yellow glow effect for all selected elements (stations, misc nodes, and line styles) using SVG filter animations, addressing the user request for visual feedback without modifying individual element components.
Problem
Users needed a visual indicator to clearly identify selected elements on the canvas. The requirement was to implement a dynamic glow effect (外发光效果) using SVG animation functionality while avoiding modifications to each individual element implementation.
Solution
Added an animated SVG filter that applies a fluorescent yellow pulsating glow effect to selected elements:
Technical Implementation
#selected-glowfilter with animated Gaussian blurKey Changes
svg-wrapper.tsx): Added animated fluorescent yellow glow filter with fast 0.5-second pulsating cyclesvg-layer.tsx): Wrap all selected element components (pre, main, post) with glow filter groupsvg-canvas-graph.tsx): Pass selection state to SVG layerThe filter uses
feColorMatrixto create fluorescent yellow color andfeGaussianBlurwith<animate>to create a smooth fast pulsating effect from 1px to 3px blur radius, providing clear visual feedback with crisp edges for element selection.Visual Result
The screenshot shows a station with the bright fluorescent yellow animated glow effect applied, demonstrating the smooth visual feedback for selected elements.
Benefits
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.