mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user