Skip to content

Marquee Selection: Marching Ants Animation Infrastructure [FEATURE]#3977

Draft
Chetansahney wants to merge 3 commits intoGraphiteEditor:masterfrom
Chetansahney:feature/marching-ants-animation
Draft

Marquee Selection: Marching Ants Animation Infrastructure [FEATURE]#3977
Chetansahney wants to merge 3 commits intoGraphiteEditor:masterfrom
Chetansahney:feature/marching-ants-animation

Conversation

@Chetansahney
Copy link
Copy Markdown

#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

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

medium

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)

medium

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)

medium

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.;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant