Skip to content

Remove the legacy Fill, Gradient, and PathStyle types now that paints live in attributes#4297

Merged
Keavon merged 10 commits into
GraphiteEditor:masterfrom
YohYamasaki:remove-legacy-style-structs
Jul 5, 2026
Merged

Remove the legacy Fill, Gradient, and PathStyle types now that paints live in attributes#4297
Keavon merged 10 commits into
GraphiteEditor:masterfrom
YohYamasaki:remove-legacy-style-structs

Conversation

@YohYamasaki

@YohYamasaki YohYamasaki commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Part of #2779.

As we now use attributes with List<T> for the fill and stroke paints, some of the style-related structures and enumerations have become obsolete. This PR involves refactoring to remove these, such as...

  • the Gradient struct
  • the 'Fill' enum
  • the 'color' field of the 'Stroke' struct
  • the 'PathStyle' struct

Legacy representations are kept only where needed for document migration.

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

Copy link
Copy Markdown
Contributor

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 refactors the vector graphics style system by replacing the legacy Fill enum and PathStyle struct with a more flexible, attribute-based paint system using ATTR_FILL and ATTR_STROKE with AnyGraphicListDyn. The Stroke struct has been updated to remove its color field, which is now managed via attributes. Various tools, nodes (such as fill, stroke, boolean operations, and morphing), and document migration paths have been updated to support this new value-model paint system. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Keavon Keavon force-pushed the remove-legacy-style-structs branch from e12011f to 3d35633 Compare July 4, 2026 23:13
@YohYamasaki YohYamasaki marked this pull request as ready for review July 5, 2026 03:55

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 28 files

Confidence score: 3/5

  • In node-graph/libraries/graphic-types/src/graphic.rs, the opacity helpers (is_fill_opaque_at, is_stroke_opaque_at, and the new is_paint_opaque_at) now rely on attribute-only lookups after removing legacy style fallbacks, which can change opacity results for graphics that still depend on inherited/legacy style paths and lead to incorrect rendering behavior if merged as-is — add a compatibility fallback (or explicit migration + regression tests for legacy-style documents) before merging.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread node-graph/libraries/graphic-types/src/graphic.rs
@Keavon Keavon changed the title Remove legacy style-related structs Remove the legacy Fill, Gradient, and PathStyle types now that paints live in attributes Jul 5, 2026
@Keavon Keavon merged commit 6a54dcb into GraphiteEditor:master Jul 5, 2026
11 checks passed
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.

2 participants