mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 06:38:03 +08:00
Derive extent forwarding for level-preserving passthroughs
This commit is contained in:
@@ -1441,6 +1441,14 @@ pub(crate) fn generate_node_impl(crate_ident: &CrateIdent, parsed: &ParsedNodeFn
|
||||
#core_types::node::Node::extent_at(&self.#name, __input, __level + #folded_levels)
|
||||
}
|
||||
}
|
||||
} else if let Some(subject_index) = ir::forwarded_subject(&node).filter(|_| node.output.shape.depth == 0) {
|
||||
// A level-preserving passthrough forwards its subject's extents.
|
||||
let name = ®ular_fields[subject_index].pat_ident.ident;
|
||||
quote! {
|
||||
fn extent_at(&self, __input: &#ctx_ident, __level: u8) -> #core_types::gpoll::GPoll<#core_types::gpoll::Extent> {
|
||||
#core_types::node::Node::extent_at(&self.#name, __input, __level)
|
||||
}
|
||||
}
|
||||
} else if node.output.shape.depth > 0 {
|
||||
// A leveled output without an extent fn reports a lower bound;
|
||||
// consumers size it by draining to the past-end signal.
|
||||
|
||||
Reference in New Issue
Block a user