mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Give To Graphic a unit row so an unconnected content input renders as nothing
This commit is contained in:
@@ -122,6 +122,12 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, Vec<RegistryEntry>> {
|
||||
.into_iter()
|
||||
.map(|entry| (graphene_std::graphic::to_graphic::IDENTIFIER.clone(), entry)),
|
||||
);
|
||||
// The unit row of To Graphic: an unconnected content input renders as nothing.
|
||||
node_types.extend(
|
||||
graphene_std::graphic::to_graphic_unit_entries()
|
||||
.into_iter()
|
||||
.map(|entry| (graphene_std::graphic::to_graphic::IDENTIFIER.clone(), entry)),
|
||||
);
|
||||
// The transitional level bridge: a leveled wire materializes into the legacy
|
||||
// list an unconverted consumer expects. The rows are keyed under the legacy
|
||||
// convert identifiers and die with the last legacy consumer.
|
||||
|
||||
@@ -552,6 +552,17 @@ pub fn to_graphic_typed<T: Clone + Send + Sync + core_types::CacheHash + 'static
|
||||
}))
|
||||
}
|
||||
|
||||
/// An unconnected content input carries the unit, which renders as nothing like
|
||||
/// the pre-flip empty list. Registered under the to graphic identifier.
|
||||
#[node_macro::node(category(""), extent(to_graphic_unit_extent))]
|
||||
pub fn to_graphic_unit(_: impl Ctx + ExtractIndex + InjectIndex + Copy, _content: ()) -> Result<IList<Graphic>, Interrupt> {
|
||||
Err(core_types::gpoll::GraphError::past_end().into())
|
||||
}
|
||||
|
||||
fn to_graphic_unit_extent(_content: core_types::extent::ValueIn<'_, ()>, _level: LevelIn) -> GPoll<Extent> {
|
||||
GPoll::Final(Extent::Exactly(0))
|
||||
}
|
||||
|
||||
/// The transitional level bridge: the wire's records as the legacy list an
|
||||
/// unconverted consumer expects, attributes copied through their erased
|
||||
/// reads. Registered under the legacy convert identifiers; the rows die with
|
||||
@@ -570,6 +581,7 @@ pub fn level_to_list<T: Clone + Send + Sync + CacheHash + 'static>(
|
||||
pub use _level_to_list_mod::level_to_list_entries;
|
||||
pub use _to_graphic_element_mod::to_graphic_element_entries;
|
||||
pub use _to_graphic_typed_mod::to_graphic_typed_entries;
|
||||
pub use _to_graphic_unit_mod::to_graphic_unit_entries;
|
||||
|
||||
/// Removes a level of nesting from a `Graphic[]`, or all nesting if "Fully Flatten" is enabled.
|
||||
#[node_macro::node(category("General"), extent(flatten_graphic_extent))]
|
||||
|
||||
Reference in New Issue
Block a user