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

* Remove `Stroke.color`

* Remove legacy Gradient struct usage

* Fix gradient tool tests

* Remove `Fill` enum

* Fix direction of `gradient_orientation_rightward`

* Remove `Gradient` struct

* Remove `PathStyle` struct

* Fix old `VectorData` migration

* Refactor

- Remove unnecessary wrapper functions
- Use `as_ref` instead of `clone` for stroke if possible
- Comment cleanup

* Clean up stale style comments and bindings left by the paint attribute migration

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
YohYamasaki
2026-07-05 08:08:06 +02:00
committed by GitHub
parent 9f9899cfd0
commit 6a54dcb5da
28 changed files with 887 additions and 1334 deletions

View File

@@ -14,8 +14,7 @@ use graphene_std::memo::IORecord;
use graphene_std::raster::{CPU, Raster};
use graphene_std::renderer::{RenderMetadata, graphic_list_bounding_box};
use graphene_std::transform::Footprint;
use graphene_std::vector::Vector;
use graphene_std::vector::style::Gradient;
use graphene_std::vector::{Vector, graphic_types};
use graphene_std::{ATTR_TRANSFORM, Context, Graphic, NodeInputDecleration};
use interpreted_executor::dynamic_executor::ResolvedDocumentNodeTypesDelta;
use std::any::Any;
@@ -83,7 +82,7 @@ struct ExecutionContext {
/// Set when this execution is a gradient-migration measurement run, carrying the "Fill" node (addressed by its enclosing
/// network path) and its original relative gradient. The evaluated geometry is read back from the inspect result to size the
/// gradient; such runs never touch the visible artwork. Carrying the entry keeps a stale re-dispatched response paired with the fill it measured.
measure_fill: Option<(Vec<NodeId>, NodeId, Gradient)>,
measure_fill: Option<(Vec<NodeId>, NodeId, graphic_types::migrations::legacy::Gradient)>,
}
// TODO: Eventually remove this document upgrade code
@@ -93,7 +92,7 @@ struct ExecutionContext {
#[derive(Debug, Clone)]
struct GradientMigration {
document_id: DocumentId,
remaining: VecDeque<(Vec<NodeId>, NodeId, Gradient)>,
remaining: VecDeque<(Vec<NodeId>, NodeId, graphic_types::migrations::legacy::Gradient)>,
resolution: UVec2,
scale: f64,
}
@@ -493,7 +492,7 @@ impl NodeGraphExecutor {
}
// Snapshot the queue but leave `pending_gradient_bbox_bake` populated, so subsequent render requests keep deferring here (and hit the guard above); each entry is removed from the document as its bake lands.
let remaining: VecDeque<(Vec<NodeId>, NodeId, Gradient)> = document.pending_gradient_bbox_bake.iter().cloned().collect();
let remaining: VecDeque<(Vec<NodeId>, NodeId, graphic_types::migrations::legacy::Gradient)> = document.pending_gradient_bbox_bake.iter().cloned().collect();
let Some((first_network_path, first_fill, first_gradient)) = remaining.front().cloned() else {
return false;
};
@@ -520,7 +519,7 @@ impl NodeGraphExecutor {
document_id: DocumentId,
network_path: Vec<NodeId>,
fill_node_id: NodeId,
gradient: Gradient,
gradient: graphic_types::migrations::legacy::Gradient,
resolution: UVec2,
scale: f64,
responses: &mut VecDeque<Message>,
@@ -589,7 +588,7 @@ impl NodeGraphExecutor {
&mut self,
document: &mut DocumentMessageHandler,
document_id: DocumentId,
bake_target: (Vec<NodeId>, NodeId, Gradient),
bake_target: (Vec<NodeId>, NodeId, graphic_types::migrations::legacy::Gradient),
inspect_result: Option<InspectResult>,
responses: &mut VecDeque<Message>,
) {