From a8d257e7d60b74406f9d02eef408e282710df5d9 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sat, 22 Aug 2026 09:34:17 +0000 Subject: [PATCH] Move the downstream-typed attribute markers to their value types' crates --- node-graph/libraries/core-types/src/lib.rs | 5 +- node-graph/libraries/core-types/src/list.rs | 16 +---- .../libraries/graphic-types/src/graphic.rs | 3 +- .../libraries/rendering/src/render_ext.rs | 4 +- .../libraries/rendering/src/renderer.rs | 7 +- node-graph/libraries/resources/src/lib.rs | 7 ++ node-graph/libraries/vector-types/src/lib.rs | 2 + .../libraries/vector-types/src/markers.rs | 65 +++++++++++++++++++ node-graph/nodes/gstd/src/text.rs | 2 +- node-graph/nodes/math/src/lib.rs | 4 +- node-graph/nodes/path-bool/src/lib.rs | 6 +- node-graph/nodes/text/src/lib.rs | 2 + node-graph/nodes/text/src/markers.rs | 32 +++++++++ node-graph/nodes/text/src/path_builder.rs | 3 +- node-graph/nodes/text/src/to_path.rs | 4 +- .../vector/src/vector_modification_nodes.rs | 3 +- node-graph/nodes/vector/src/vector_nodes.rs | 6 +- 17 files changed, 132 insertions(+), 39 deletions(-) create mode 100644 node-graph/libraries/vector-types/src/markers.rs create mode 100644 node-graph/nodes/text/src/markers.rs diff --git a/node-graph/libraries/core-types/src/lib.rs b/node-graph/libraries/core-types/src/lib.rs index 20a95eeab5..b7ef0e5179 100644 --- a/node-graph/libraries/core-types/src/lib.rs +++ b/node-graph/libraries/core-types/src/lib.rs @@ -31,9 +31,8 @@ pub use dyn_any::{StaticTypeSized, WasmNotSend, WasmNotSync}; pub use graphene_hash; pub use graphene_hash::CacheHash; pub use list::{ - ATTR_BACKGROUND, ATTR_BLEND_MODE, ATTR_CLIP, ATTR_CLIPPING_MASK, ATTR_DIMENSIONS, ATTR_EDITOR_CLICK_TARGET, ATTR_EDITOR_LAYER_PATH, ATTR_EDITOR_MERGED_LAYERS, ATTR_EDITOR_TEXT_FRAME, ATTR_END, - ATTR_FONT, ATTR_FONT_SIZE, ATTR_GRADIENT_TYPE, ATTR_LETTER_SPACING, ATTR_LETTER_TILT, ATTR_LINE_HEIGHT, ATTR_LOCATION, ATTR_MAX_HEIGHT, ATTR_MAX_WIDTH, ATTR_NAME, ATTR_OPACITY, ATTR_OPACITY_FILL, - ATTR_SPREAD_METHOD, ATTR_START, ATTR_TEXT_ALIGN, ATTR_TRANSFORM, ATTR_TYPE, + ATTR_BACKGROUND, ATTR_BLEND_MODE, ATTR_CLIP, ATTR_CLIPPING_MASK, ATTR_DIMENSIONS, ATTR_EDITOR_LAYER_PATH, ATTR_EDITOR_MERGED_LAYERS, ATTR_EDITOR_TEXT_FRAME, ATTR_END, ATTR_FONT_SIZE, + ATTR_LETTER_SPACING, ATTR_LETTER_TILT, ATTR_LINE_HEIGHT, ATTR_LOCATION, ATTR_MAX_HEIGHT, ATTR_MAX_WIDTH, ATTR_NAME, ATTR_OPACITY, ATTR_OPACITY_FILL, ATTR_START, ATTR_TRANSFORM, ATTR_TYPE, }; pub use memo::MemoHash; pub use no_std_types::AsU32; diff --git a/node-graph/libraries/core-types/src/list.rs b/node-graph/libraries/core-types/src/list.rs index 572e790a86..cb0c30868c 100644 --- a/node-graph/libraries/core-types/src/list.rs +++ b/node-graph/libraries/core-types/src/list.rs @@ -36,29 +36,17 @@ pub const ATTR_MAX_WIDTH: &str = crate::attribute::MaxWidth::NAME; pub const ATTR_MAX_HEIGHT: &str = crate::attribute::MaxHeight::NAME; pub const ATTR_LETTER_TILT: &str = crate::attribute::LetterTilt::NAME; -// The remaining names' value types live below core-types. Their markers and -// constants move to the crates that own those types with the marker wave. +// The remaining names' value types live in graphic-types. Their markers and +// constants move there with the marker wave. /// `List` snapshot of the upstream content that fed into a destructive merge /// (Boolean Operation, Rasterize, etc.), so the editor can still surface click targets for /// the original child layers after their content has been collapsed. pub const ATTR_EDITOR_MERGED_LAYERS: &str = "editor:merged_layers"; -/// Optional `Vector` that overrides the item's own geometry for click-target generation. -/// Used by the 'Text' node for per-glyph bounding-box rectangles so glyphs are selectable -/// by clicking anywhere within their bounds, not just the filled letterform. -pub const ATTR_EDITOR_CLICK_TARGET: &str = "editor:click_target"; -/// Gradient's `GradientSpreadMethod` (`Pad`, `Reflect`, or `Repeat`). -pub const ATTR_SPREAD_METHOD: &str = "spread_method"; -/// Gradient's `GradientType` (`Linear` or `Radial`). -pub const ATTR_GRADIENT_TYPE: &str = "gradient_type"; /// Vector graphics object's filled area paint, of type List where T is any graphic type. pub const ATTR_FILL: &str = "fill"; /// Vector graphics object's stroke paint, of type List where T is any graphic type. pub const ATTR_STROKE: &str = "stroke"; -/// Text item's font, as a `Resource` of the loaded font file. -pub const ATTR_FONT: &str = "font"; -/// Text item's `TextAlign` horizontal alignment of lines within the block. -pub const ATTR_TEXT_ALIGN: &str = "text_align"; // =========================== // Implicit attribute defaults diff --git a/node-graph/libraries/graphic-types/src/graphic.rs b/node-graph/libraries/graphic-types/src/graphic.rs index 21eb52ab03..ad6daa38e0 100644 --- a/node-graph/libraries/graphic-types/src/graphic.rs +++ b/node-graph/libraries/graphic-types/src/graphic.rs @@ -933,8 +933,7 @@ mod tests { #[cfg(test)] mod graphic_is_opaque_tests { - use core_types::ATTR_SPREAD_METHOD; - use vector_types::{GradientSpreadMethod, GradientStop}; + use vector_types::{ATTR_SPREAD_METHOD, GradientSpreadMethod, GradientStop}; use super::*; diff --git a/node-graph/libraries/rendering/src/render_ext.rs b/node-graph/libraries/rendering/src/render_ext.rs index 31182b0754..f2df687c53 100644 --- a/node-graph/libraries/rendering/src/render_ext.rs +++ b/node-graph/libraries/rendering/src/render_ext.rs @@ -3,14 +3,14 @@ use crate::{Render, RenderSvgSegmentList, SvgRender}; use core_types::color::SRGBA8; use core_types::list::List; use core_types::uuid::generate_uuid; -use core_types::{ATTR_GRADIENT_TYPE, ATTR_SPREAD_METHOD, ATTR_TRANSFORM, Color}; +use core_types::{ATTR_TRANSFORM, Color}; use glam::{DAffine2, DVec2}; use graphic_types::Graphic; use graphic_types::vector_types::gradient::GradientType; use graphic_types::vector_types::vector::style::{PaintOrder, Stroke, StrokeAlign, StrokeCap, StrokeJoin}; use std::fmt::Write; -use vector_types::GradientStops; use vector_types::gradient::GradientSpreadMethod; +use vector_types::{ATTR_GRADIENT_TYPE, ATTR_SPREAD_METHOD, GradientStops}; #[derive(Copy, Clone, PartialEq)] pub enum PaintTarget { diff --git a/node-graph/libraries/rendering/src/renderer.rs b/node-graph/libraries/rendering/src/renderer.rs index 7e538acc75..b23b5c01db 100644 --- a/node-graph/libraries/rendering/src/renderer.rs +++ b/node-graph/libraries/rendering/src/renderer.rs @@ -13,9 +13,8 @@ use core_types::render_complexity::RenderComplexity; use core_types::transform::Footprint; use core_types::uuid::{NodeId, generate_uuid}; use core_types::{ - ATTR_BACKGROUND, ATTR_BLEND_MODE, ATTR_CLIP, ATTR_CLIPPING_MASK, ATTR_DIMENSIONS, ATTR_EDITOR_CLICK_TARGET, ATTR_EDITOR_LAYER_PATH, ATTR_EDITOR_MERGED_LAYERS, ATTR_EDITOR_TEXT_FRAME, ATTR_FONT, - ATTR_FONT_SIZE, ATTR_GRADIENT_TYPE, ATTR_LETTER_SPACING, ATTR_LETTER_TILT, ATTR_LINE_HEIGHT, ATTR_LOCATION, ATTR_MAX_HEIGHT, ATTR_MAX_WIDTH, ATTR_OPACITY, ATTR_OPACITY_FILL, ATTR_SPREAD_METHOD, - ATTR_TEXT_ALIGN, ATTR_TRANSFORM, + ATTR_BACKGROUND, ATTR_BLEND_MODE, ATTR_CLIP, ATTR_CLIPPING_MASK, ATTR_DIMENSIONS, ATTR_EDITOR_LAYER_PATH, ATTR_EDITOR_MERGED_LAYERS, ATTR_EDITOR_TEXT_FRAME, ATTR_FONT_SIZE, ATTR_LETTER_SPACING, + ATTR_LETTER_TILT, ATTR_LINE_HEIGHT, ATTR_LOCATION, ATTR_MAX_HEIGHT, ATTR_MAX_WIDTH, ATTR_OPACITY, ATTR_OPACITY_FILL, ATTR_TRANSFORM, }; use dyn_any::DynAny; use glam::{DAffine2, DMat2, DVec2}; @@ -39,7 +38,9 @@ use std::fmt::Write; use std::hash::Hash; use std::ops::Deref; use std::sync::{Arc, LazyLock}; +use text_nodes::{ATTR_FONT, ATTR_TEXT_ALIGN}; use vector_types::gradient::GradientSpreadMethod; +use vector_types::{ATTR_EDITOR_CLICK_TARGET, ATTR_GRADIENT_TYPE, ATTR_SPREAD_METHOD}; use vello::*; #[derive(Clone, Copy, Debug, PartialEq)] diff --git a/node-graph/libraries/resources/src/lib.rs b/node-graph/libraries/resources/src/lib.rs index 8c3e195b64..5e592354a2 100644 --- a/node-graph/libraries/resources/src/lib.rs +++ b/node-graph/libraries/resources/src/lib.rs @@ -38,6 +38,13 @@ impl Default for Resource { } } +impl Default for &Resource { + fn default() -> Self { + static EMPTY: std::sync::LazyLock = std::sync::LazyLock::new(Resource::empty); + std::sync::LazyLock::force(&EMPTY) + } +} + impl From<&Resource> for Arc + Send + Sync> { fn from(val: &Resource) -> Self { val.inner.clone() diff --git a/node-graph/libraries/vector-types/src/lib.rs b/node-graph/libraries/vector-types/src/lib.rs index 6ff415e567..42b24aea4c 100644 --- a/node-graph/libraries/vector-types/src/lib.rs +++ b/node-graph/libraries/vector-types/src/lib.rs @@ -2,6 +2,7 @@ extern crate log; pub mod gradient; +pub mod markers; pub mod math; pub mod subpath; pub mod vector; @@ -9,6 +10,7 @@ pub mod vector; // Re-export commonly used types at the crate root pub use core_types as gcore; pub use gradient::{GradientSpreadMethod, GradientStop, GradientStops, GradientType}; +pub use markers::{ATTR_EDITOR_CLICK_TARGET, ATTR_GRADIENT_TYPE, ATTR_SPREAD_METHOD}; pub use math::{QuadExt, RectExt}; pub use subpath::Subpath; pub use vector::Vector; diff --git a/node-graph/libraries/vector-types/src/markers.rs b/node-graph/libraries/vector-types/src/markers.rs new file mode 100644 index 0000000000..47a114fce7 --- /dev/null +++ b/node-graph/libraries/vector-types/src/markers.rs @@ -0,0 +1,65 @@ +//! Attribute markers whose value types live in this crate, with their name +//! constants for the string-keyed legacy readers and writers. + +use core_types::attribute::Attribute; +use core_types::list::AnyAttributeValue; + +core_types::attribute! { + /// Gradient's spread behavior past its endpoints (`Pad`, `Reflect`, or `Repeat`). + pub SpreadMethod("spread_method"): crate::gradient::GradientSpreadMethod; + /// Gradient's shape (`Linear` or `Radial`). + pub GradientType("gradient_type"): crate::gradient::GradientType; +} + +/// Optional `Vector` that overrides the item's own geometry for click-target generation. +/// Used by the 'Text' node for per-glyph bounding-box rectangles so glyphs are selectable +/// by clicking anywhere within their bounds, not just the filled letterform. An absent +/// value means the item's own geometry is the click target. +pub struct EditorClickTarget; + +impl Attribute for EditorClickTarget { + const NAME: &'static str = "editor:click_target"; + type Value<'e> = Option<&'e crate::Vector>; + + unsafe fn read_erased(ptr: *const u8) -> Box { + Box::new(unsafe { ptr.cast::>().read() }.cloned()) + } + + const REPARK: Option Option<()>> = { + unsafe fn repark(value: &dyn AnyAttributeValue, dst: *mut u8, arena: &core_types::arena::Arena) -> Option<()> { + let owned: &Option = value.as_any().downcast_ref().expect("an optional vector attribute replays its owned clone"); + let parked = match owned { + Some(vector) => Some(arena.alloc(vector.clone())?.0), + None => None, + }; + unsafe { dst.cast::>().write(parked) }; + Some(()) + } + Some(repark) + }; +} + +core_types::attribute!(@register EditorClickTarget); + +pub const ATTR_SPREAD_METHOD: &str = SpreadMethod::NAME; +pub const ATTR_GRADIENT_TYPE: &str = GradientType::NAME; +pub const ATTR_EDITOR_CLICK_TARGET: &str = EditorClickTarget::NAME; + +#[cfg(test)] +mod tests { + use super::*; + use core_types::attribute::info; + use std::any::TypeId; + + #[test] + fn the_census_carries_this_crates_names() { + assert_eq!(info("gradient_type").unwrap().value_type, TypeId::of::()); + assert_eq!(info("spread_method").unwrap().value_type, TypeId::of::()); + assert_eq!(info("editor:click_target").unwrap().value_type, TypeId::of::>()); + } + + #[test] + fn an_absent_click_target_defaults_to_none() { + assert_eq!(::default(), None); + } +} diff --git a/node-graph/nodes/gstd/src/text.rs b/node-graph/nodes/gstd/src/text.rs index 1d537db016..7d44390289 100644 --- a/node-graph/nodes/gstd/src/text.rs +++ b/node-graph/nodes/gstd/src/text.rs @@ -1,6 +1,6 @@ use core_types::consts::{DEFAULT_FONT_SIZE, DEFAULT_LINE_HEIGHT}; use core_types::list::List; -use core_types::{ATTR_FONT, ATTR_FONT_SIZE, ATTR_LETTER_SPACING, ATTR_LETTER_TILT, ATTR_LINE_HEIGHT, ATTR_MAX_HEIGHT, ATTR_MAX_WIDTH, ATTR_TEXT_ALIGN, Ctx}; +use core_types::{ATTR_FONT_SIZE, ATTR_LETTER_SPACING, ATTR_LETTER_TILT, ATTR_LINE_HEIGHT, ATTR_MAX_HEIGHT, ATTR_MAX_WIDTH, Ctx}; use graph_craft::application_io::resource::Resource; use graphic_types::Vector; pub use text_nodes::*; diff --git a/node-graph/nodes/math/src/lib.rs b/node-graph/nodes/math/src/lib.rs index cf52605ddb..987f962095 100644 --- a/node-graph/nodes/math/src/lib.rs +++ b/node-graph/nodes/math/src/lib.rs @@ -868,7 +868,7 @@ fn gradient_value(_: impl Ctx, _primary: (), gradient: List) -> L /// Sets the type (linear or radial) of each gradient in the input list. #[node_macro::node(category("Color"))] fn gradient_type(_: impl Ctx, mut gradient: List, gradient_type: vector_types::GradientType) -> List { - for value in gradient.iter_attribute_values_mut_or_default::(core_types::ATTR_GRADIENT_TYPE) { + for value in gradient.iter_attribute_values_mut_or_default::(vector_types::ATTR_GRADIENT_TYPE) { *value = gradient_type; } gradient @@ -877,7 +877,7 @@ fn gradient_type(_: impl Ctx, mut gradient: List, gradient_type: /// Sets how each gradient in the input list extends past its endpoints: Pad, Reflect, or Repeat. #[node_macro::node(category("Color"))] fn spread_method(_: impl Ctx, mut gradient: List, spread_method: vector_types::GradientSpreadMethod) -> List { - for value in gradient.iter_attribute_values_mut_or_default::(core_types::ATTR_SPREAD_METHOD) { + for value in gradient.iter_attribute_values_mut_or_default::(vector_types::ATTR_SPREAD_METHOD) { *value = spread_method; } gradient diff --git a/node-graph/nodes/path-bool/src/lib.rs b/node-graph/nodes/path-bool/src/lib.rs index ce84b7741e..18fa295b82 100644 --- a/node-graph/nodes/path-bool/src/lib.rs +++ b/node-graph/nodes/path-bool/src/lib.rs @@ -1,12 +1,10 @@ use core_types::list::{ATTR_FILL, Item, List}; use core_types::uuid::NodeId; -use core_types::{ - ATTR_BLEND_MODE, ATTR_CLIPPING_MASK, ATTR_EDITOR_LAYER_PATH, ATTR_EDITOR_MERGED_LAYERS, ATTR_GRADIENT_TYPE, ATTR_OPACITY, ATTR_OPACITY_FILL, ATTR_SPREAD_METHOD, ATTR_TRANSFORM, BlendMode, Color, - Ctx, -}; +use core_types::{ATTR_BLEND_MODE, ATTR_CLIPPING_MASK, ATTR_EDITOR_LAYER_PATH, ATTR_EDITOR_MERGED_LAYERS, ATTR_OPACITY, ATTR_OPACITY_FILL, ATTR_TRANSFORM, BlendMode, Color, Ctx}; use glam::{DAffine2, DVec2}; use graphic_types::graphic::{bake_paint_transforms, set_paint_attribute}; use graphic_types::vector_types::gradient::{GradientSpreadMethod, GradientType}; +use graphic_types::vector_types::{ATTR_GRADIENT_TYPE, ATTR_SPREAD_METHOD}; use graphic_types::vector_types::subpath::{ManipulatorGroup, Subpath}; use graphic_types::vector_types::vector::PointId; use graphic_types::vector_types::vector::algorithms::merge_by_distance::MergeByDistanceExt; diff --git a/node-graph/nodes/text/src/lib.rs b/node-graph/nodes/text/src/lib.rs index 5a8ae12eb2..6b0612a86a 100644 --- a/node-graph/nodes/text/src/lib.rs +++ b/node-graph/nodes/text/src/lib.rs @@ -1,6 +1,7 @@ pub mod fallback; mod font; pub mod json; +pub mod markers; mod path_builder; pub mod regex; mod text_context; @@ -20,6 +21,7 @@ use unicode_segmentation::UnicodeSegmentation; pub use core_types as gcore; pub use fallback::FALLBACK_FONT_RESOURCE; pub use font::*; +pub use markers::{ATTR_FONT, ATTR_TEXT_ALIGN}; pub use text_context::{TextContext, for_each_styled_glyph_run}; pub use to_path::*; pub use vector_types; diff --git a/node-graph/nodes/text/src/markers.rs b/node-graph/nodes/text/src/markers.rs new file mode 100644 index 0000000000..999b5c1a84 --- /dev/null +++ b/node-graph/nodes/text/src/markers.rs @@ -0,0 +1,32 @@ +//! Attribute markers whose value types live in this crate, with their name +//! constants for the string-keyed legacy readers and writers. + +use core_types::attribute::Attribute; + +core_types::attribute! { + /// Text item's font, as a resource of the loaded font file. + pub Font("font"): &graphene_resource::Resource; + /// Text item's horizontal alignment of lines within the block. + pub TextAlign("text_align"): crate::TextAlign; +} + +pub const ATTR_FONT: &str = Font::NAME; +pub const ATTR_TEXT_ALIGN: &str = TextAlign::NAME; + +#[cfg(test)] +mod tests { + use super::*; + use core_types::attribute::info; + use std::any::TypeId; + + #[test] + fn the_census_carries_this_crates_names() { + assert_eq!(info("font").unwrap().value_type, TypeId::of::<&'static graphene_resource::Resource>()); + assert_eq!(info("text_align").unwrap().value_type, TypeId::of::()); + } + + #[test] + fn the_font_default_is_the_empty_resource() { + assert!(::default().is_empty()); + } +} diff --git a/node-graph/nodes/text/src/path_builder.rs b/node-graph/nodes/text/src/path_builder.rs index 740d120a0e..eb037bcf19 100644 --- a/node-graph/nodes/text/src/path_builder.rs +++ b/node-graph/nodes/text/src/path_builder.rs @@ -1,5 +1,5 @@ use core_types::list::{Item, List}; -use core_types::{ATTR_EDITOR_CLICK_TARGET, ATTR_EDITOR_TEXT_FRAME, ATTR_TRANSFORM}; +use core_types::{ATTR_EDITOR_TEXT_FRAME, ATTR_TRANSFORM}; use glam::{DAffine2, DVec2}; use parley::GlyphRun; use skrifa::GlyphId; @@ -7,6 +7,7 @@ use skrifa::instance::{LocationRef, NormalizedCoord, Size}; use skrifa::outline::{DrawSettings, OutlinePen}; use skrifa::raw::FontRef as ReadFontsRef; use skrifa::{MetadataProvider, OutlineGlyph}; +use vector_types::ATTR_EDITOR_CLICK_TARGET; use vector_types::subpath::{ManipulatorGroup, Subpath}; use vector_types::vector::{PointId, Vector}; diff --git a/node-graph/nodes/text/src/to_path.rs b/node-graph/nodes/text/src/to_path.rs index 1ffc20df62..944c02ba72 100644 --- a/node-graph/nodes/text/src/to_path.rs +++ b/node-graph/nodes/text/src/to_path.rs @@ -3,9 +3,9 @@ use super::text_context::TextContext; use core_types::blending::BlendMode; use core_types::list::List; use core_types::uuid::NodeId; +use crate::markers::{ATTR_FONT, ATTR_TEXT_ALIGN}; use core_types::{ - ATTR_BLEND_MODE, ATTR_EDITOR_LAYER_PATH, ATTR_FONT, ATTR_FONT_SIZE, ATTR_LETTER_SPACING, ATTR_LETTER_TILT, ATTR_LINE_HEIGHT, ATTR_MAX_HEIGHT, ATTR_MAX_WIDTH, ATTR_OPACITY, ATTR_OPACITY_FILL, - ATTR_TEXT_ALIGN, ATTR_TRANSFORM, + ATTR_BLEND_MODE, ATTR_EDITOR_LAYER_PATH, ATTR_FONT_SIZE, ATTR_LETTER_SPACING, ATTR_LETTER_TILT, ATTR_LINE_HEIGHT, ATTR_MAX_HEIGHT, ATTR_MAX_WIDTH, ATTR_OPACITY, ATTR_OPACITY_FILL, ATTR_TRANSFORM, }; use glam::{DAffine2, DVec2}; use graphene_resource::Resource; diff --git a/node-graph/nodes/vector/src/vector_modification_nodes.rs b/node-graph/nodes/vector/src/vector_modification_nodes.rs index 5123466c4e..6a67c878bf 100644 --- a/node-graph/nodes/vector/src/vector_modification_nodes.rs +++ b/node-graph/nodes/vector/src/vector_modification_nodes.rs @@ -1,8 +1,9 @@ use core_types::list::List; use core_types::uuid::NodeId; -use core_types::{ATTR_EDITOR_CLICK_TARGET, ATTR_EDITOR_LAYER_PATH, ATTR_TRANSFORM, Ctx}; +use core_types::{ATTR_EDITOR_LAYER_PATH, ATTR_TRANSFORM, Ctx}; use glam::DAffine2; use graphic_types::Vector; +use vector_types::ATTR_EDITOR_CLICK_TARGET; use vector_types::vector::VectorModification; /// Applies a differential modification to a vector path, associating changes made by the Pen and Path tools to indices of edited points and segments. diff --git a/node-graph/nodes/vector/src/vector_nodes.rs b/node-graph/nodes/vector/src/vector_nodes.rs index bb2202505e..adaa2ec5d5 100644 --- a/node-graph/nodes/vector/src/vector_nodes.rs +++ b/node-graph/nodes/vector/src/vector_nodes.rs @@ -8,10 +8,7 @@ use core_types::list::{ATTR_FILL, ATTR_STROKE, Item, ItemAttributeValues, List, use core_types::registry::types::{Angle, Length, Multiplier, Percentage, PixelLength, Progression, SeedValue}; use core_types::transform::{Footprint, Transform}; use core_types::uuid::NodeId; -use core_types::{ - ATTR_BLEND_MODE, ATTR_CLIPPING_MASK, ATTR_EDITOR_LAYER_PATH, ATTR_EDITOR_MERGED_LAYERS, ATTR_GRADIENT_TYPE, ATTR_OPACITY, ATTR_OPACITY_FILL, ATTR_SPREAD_METHOD, ATTR_TRANSFORM, Color, Ctx, - DeriveCtx, -}; +use core_types::{ATTR_BLEND_MODE, ATTR_CLIPPING_MASK, ATTR_EDITOR_LAYER_PATH, ATTR_EDITOR_MERGED_LAYERS, ATTR_OPACITY, ATTR_OPACITY_FILL, ATTR_TRANSFORM, Color, Ctx, DeriveCtx}; use glam::{DAffine2, DMat2, DVec2}; use graphic_types::Vector; use graphic_types::graphic::{bake_paint_transforms, graphic_list_at, has_paint_at, is_paint_present, set_paint_attribute_at}; @@ -23,6 +20,7 @@ use rand::{Rng, SeedableRng}; use std::collections::hash_map::DefaultHasher; use vector_types::gradient::{build_transform_with_y_preservation, initial_gradient_transform_for_bounding_box}; use vector_types::subpath::{BezierHandles, ManipulatorGroup}; +use vector_types::{ATTR_GRADIENT_TYPE, ATTR_SPREAD_METHOD}; use vector_types::vector::PointDomain; use vector_types::vector::algorithms::bezpath_algorithms::{self, TValue, eval_pathseg_euclidean, evaluate_bezpath, split_bezpath, tangent_on_bezpath}; use vector_types::vector::algorithms::merge_by_distance::MergeByDistanceExt;