Support spread method for gradient#3953
Support spread method for gradient#3953YohYamasaki wants to merge 5 commits intoGraphiteEditor:masterfrom
Conversation
* Add GradientSpreadMethod enum (Pad, Repeat, Reflect) to vector-types * Add radio buttons to gradient tool and fill properties panel * Convert spread method when importing SVGs via usvg * Sync backup gradient input when changing spread method * Table<GradientStops> rendering is not yet updated for spread method
* Sync gradient_type and spread_method from the selected layer's existing gradient to the tool options bar when switching to the gradient tool * Refactor has_gradient_on_selected_layers to reuse a new get_gradient_on_selected_layer helper
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the gradient functionality by introducing various spread methods, providing users with greater control over how gradients repeat or extend beyond their defined boundaries. It also addresses a critical synchronization bug, ensuring that the gradient tool's settings consistently reflect the selections made in the property panel, thereby improving the overall user experience and reliability of gradient editing. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the concept of 'gradient spread method' to control how gradients extend beyond their defined boundaries (Pad, Repeat, Reflect). This feature is integrated by adding a new GradientSpreadMethod enum, updating the Gradient struct to include this property, and modifying gradient creation and manipulation logic. User interface controls have been added to both the node graph properties panel and the gradient tool options, allowing users to select the desired spread method. The changes also include implementing the rendering of the spread method in SVG output and within the Vello renderer, along with a new test case to verify the functionality. No feedback is provided as there were no review comments.
|
!build (Run ID 23589300382) |
|
Part of #2304
Demo
Screen.Recording.2026-03-26.at.18.44.05.mp4
Description
This PR adds support for selecting the spread method between Pad, Repeat, and Reflect.
At this moment, fix rendering
Table<GradientStops>with the spread method is out of scope since the renderer does not currently handle any spatial information. It will be addressed in PRs for #2779.The issue of the gradient tool's initially selected gradient type and spread method being out of sync with the selections in the gradient property panel has also been fixed. This occurred when users changed the settings in the property panel without selecting the gradient tool, because
GradientToolMessage::UpdateOptionssent from the property panel was not processed when the gradient tool was inactive. The screencast below shows the bug.Screen.Recording.2026-03-26.at.18.41.39.mp4