mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 18:28:12 +08:00
@@ -2043,7 +2043,7 @@ fn document_node_definitions() -> HashMap<DefinitionIdentifier, DocumentNodeDefi
|
|||||||
input_metadata: vec![
|
input_metadata: vec![
|
||||||
("Content", "TODO").into(),
|
("Content", "TODO").into(),
|
||||||
InputMetadata::with_name_description_override(
|
InputMetadata::with_name_description_override(
|
||||||
"Separation Disk Diameter",
|
"Separation",
|
||||||
"TODO",
|
"TODO",
|
||||||
WidgetOverride::Number(NumberInputSettings {
|
WidgetOverride::Number(NumberInputSettings {
|
||||||
min: Some(0.01),
|
min: Some(0.01),
|
||||||
|
|||||||
@@ -1350,6 +1350,23 @@ async fn instance_map(ctx: impl Ctx + CloneVarArgs + ExtractAll, content: Table<
|
|||||||
rows.into_iter().collect()
|
rows.into_iter().collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[node_macro::node(category("Vector"), path(graphene_core::vector))]
|
||||||
|
async fn map_points(ctx: impl Ctx + CloneVarArgs + ExtractAll, content: Table<Vector>, mapped: impl Node<Context<'static>, Output = DVec2>) -> Table<Vector> {
|
||||||
|
let mut content = content;
|
||||||
|
let mut index = 0;
|
||||||
|
|
||||||
|
for row in content.iter_mut() {
|
||||||
|
for (_, position) in row.element.point_domain.positions_mut() {
|
||||||
|
let owned_ctx = OwnedContextImpl::from(ctx.clone()).with_index(index).with_position(*position);
|
||||||
|
index += 1;
|
||||||
|
|
||||||
|
*position = mapped.eval(owned_ctx.into_context()).await;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
content
|
||||||
|
}
|
||||||
|
|
||||||
#[node_macro::node(category("Vector"), path(graphene_core::vector))]
|
#[node_macro::node(category("Vector"), path(graphene_core::vector))]
|
||||||
async fn flatten_path<T: 'n + Send>(
|
async fn flatten_path<T: 'n + Send>(
|
||||||
_: impl Ctx,
|
_: impl Ctx,
|
||||||
|
|||||||
Reference in New Issue
Block a user