Marquee Selection: Marching Ants Animation Infrastructure [FEATURE]#3977
Marquee Selection: Marching Ants Animation Infrastructure [FEATURE]#3977Chetansahney wants to merge 3 commits intoGraphiteEditor:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for gradient strokes and implements a "marching ants" animation for selection borders. The Stroke struct has been updated to include an optional gradient field, with corresponding rendering logic added for both SVG and Vello/Peniko backends. To support the animation, animation_time is now passed through the overlay message handlers and contexts. The selection tool utilizes this time to dynamically calculate dash offsets while subscribing to animation frame events. Reviewer feedback suggests minor code cleanups, including the removal of a redundant type cast and several unnecessary explanatory comments.
I am having trouble creating individual review comments. Click here to see my feedback.
editor/src/messages/portfolio/document/document_message_handler.rs (222)
The cast as f64 is redundant here, as ipp.time is already of type f64. It can be removed for cleaner code.
.process_message(message, responses, OverlaysMessageContext { visibility_settings, viewport, animation_time: ipp.time });
editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs (500)
This comment is redundant as it just describes what the code below it does. It can be removed to improve code clarity.
editor/src/messages/tool/tool_messages/select_tool.rs (994-995)
These comments are redundant as the constant names are self-explanatory. They can be removed to improve code clarity.
const MARCHING_ANTS_PIXELS_PER_SECOND: f64 = 100.;
const MARCHING_ANTS_PERIOD: f64 = 8.;
#Gsoc project solution
This PR implements the foundational animation timing logic for the "Marching Ants" selection border. While Graphite previously supported static dashed overlays, this PR introduces the ability for overlays to animate at 60 FPS independently of mouse movement by subscribing to AnimationFrame