Read a named attribute at each value type it can hold

One read node per value type, mirroring master's read family. A name
means one value type, so there is no coercion between them: master's
number read silently widened integers, and these refuse instead, which
is the same rule the write side already enforces.

Each takes any record wire through the opaque reading input and serves
the name's own default where the attribute is absent, so the value
carries the declared type either way.

The gradient enums join the value-type rows now that a family exists to
read them at.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Dennis Kobert
2026-09-09 12:36:00 +00:00
parent 5baeb8fd46
commit 0a4288eca6
2 changed files with 54 additions and 16 deletions

View File

@@ -15,6 +15,13 @@ core_types::attribute! {
pub EditorClickTarget("editor:click_target"): Option<&crate::Vector>;
}
// The value types a name-generic attribute can name here, so a compile-time
// named write or read reaches this crate's enums like any other plain value.
core_types::named_value! {
for crate::gradient::GradientSpreadMethod;
for crate::gradient::GradientType;
}
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;