Skip to content

Add temporal custom table column for gradients#4080

Closed
YohYamasaki wants to merge 5 commits intoGraphiteEditor:masterfrom
YohYamasaki:gradient-custom-table-column
Closed

Add temporal custom table column for gradients#4080
YohYamasaki wants to merge 5 commits intoGraphiteEditor:masterfrom
YohYamasaki:gradient-custom-table-column

Conversation

@YohYamasaki
Copy link
Copy Markdown
Contributor

No description provided.

* Add SVG and Vello renderers for Table<GradientStops>

* Add thumbnail rendering for Table<GradientStops>

* Use row transform to map (0,0), (1,0) unit line to document space

* Set 100px width for the initially created gradient

* Add support of table gradients for the gradient tool
* Thumbnail rendering of artboard with infinite gradient layer

* Hide radial gradient's reverse direction button for gradient table

* Remove unused imports
* Add HashMap<String, Vec<CustomColumnValue>> to Table

* Store gradient type and spread method as custom columns
  via extension traits for Table<GradientStops>

* Support gradient type and spread method in SVG and Vello renderers
  for Table<GradientStops>
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 Table<GradientStops>, enabling gradients to be managed as table data. It adds an additional metadata field to Table and TableRow to store properties like gradient type and spread method, which are now integrated into the data panel and rendering engines. The Vello renderer was updated to handle infinite gradients via manual transform encoding, and a new thumbnail_bounding_box method was added to the BoundingBox trait. A code suggestion was provided to simplify the retrieval of custom column values in the data panel.

];

for key in &additional_keys {
let value = *(row.additional.get(key).unwrap_or(&&CustomColumnValue::None));
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.

medium

Using unwrap_or with a reference to a reference (&&CustomColumnValue::None) is unnecessary and can be simplified to unwrap_or(&CustomColumnValue::None).

Suggested change
let value = *(row.additional.get(key).unwrap_or(&&CustomColumnValue::None));
let value = row.additional.get(key).unwrap_or(&CustomColumnValue::None);

@Keavon
Copy link
Copy Markdown
Member

Keavon commented Apr 29, 2026

Superseded by my changes to #3989.

@Keavon Keavon closed this Apr 29, 2026
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