Add mesh gradient support - #4081
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new "Mesh" gradient type, adding UI support in the gradient tool and implementing an initial SVG rendering path that approximates the mesh by subdividing it into an 8x8 grid of polygons. Feedback identifies critical bugs in the rendering logic, including potential panics if the geometry has fewer than four points or segments and an incorrect return statement that prevents subsequent elements from rendering. Additionally, the reviewer noted that the mesh colors are currently hardcoded and that the Vello and SVG stops table implementations are still placeholders.
4b7a823 to
847b8e9
Compare
15fcaac to
d5f0140
Compare
5785002 to
231773c
Compare
6575890 to
f097784
Compare
f2939fa to
e5de2e0
Compare
e5de2e0 to
ededf6c
Compare
- Click to add/select mesh gradient - Show transform widget inside Fill nodes
# Conflicts: # editor/src/messages/portfolio/document/data_panel/data_panel_message_handler.rs # editor/src/messages/portfolio/document/graph_operation/graph_operation_message.rs # editor/src/messages/portfolio/document/graph_operation/utility_types.rs # editor/src/messages/portfolio/document/node_graph/node_properties.rs # editor/src/messages/portfolio/document_migration.rs # node-graph/libraries/graphic-types/src/graphic.rs # node-graph/libraries/rendering/src/render_ext.rs # node-graph/libraries/rendering/src/renderer.rs # node-graph/nodes/path-bool/src/lib.rs # node-graph/nodes/vector/src/vector_nodes.rs
55d7bda to
4ef8f6f
Compare
|
@cubic-dev-ai Please review |
@YohYamasaki I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 36 files
Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.
Re-trigger cubic
# Conflicts: # node-graph/libraries/graphic-types/src/graphic.rs # node-graph/libraries/rendering/src/render_ext.rs # node-graph/libraries/rendering/src/renderer.rs # node-graph/nodes/path-bool/src/lib.rs
|
@cubic-dev-ai Please review |
@YohYamasaki I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 36 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 36 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
# Conflicts: # editor/src/messages/portfolio/document/storage_tests/round_trip_tests.rs # node-graph/libraries/graphic-types/src/appearance.rs # node-graph/nodes/graphic/src/graphic.rs # node-graph/nodes/vector/src/vector_nodes.rs
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Closes #3990
Screen.Recording.2026-08-17.at.13.03.19.mp4
Add the Coons patch-based mesh gradient paint.
Neither the current SVG specification nor Vello natively supports mesh gradient rendering, so the current implementations approximate mesh gradient behavior using linear gradients and alpha masks.
A Coons patch's shape is defined by its Bézier outlines. For SVG, it is replicated by
feDisplacementMap, and approximated subdividing into multiple parallelograms for Vello. This ensures that the original shape, before transformation, can be a rectangle with affine transformation. Then, the color in the rectangle is blended bi-linearly or bi-cubically depending on the chosen interpolation space.Known issues & limitations