View plugins

This commit is contained in:
2026-02-01 17:18:59 +01:00
parent 2ca419bfd4
commit c4addd7f01
5 changed files with 67 additions and 21 deletions
+7 -3
View File
@@ -57,9 +57,9 @@ fn emit_plugins(deps: &[ViewPlugin]) -> TokenStream {
.map(|d| {
let path = &d.path;
if let Some(args) = &d.args {
quote!( #path(ctx, view #(,#args)*); )
quote!( #path(ctx, &view #(,#args)*); )
} else {
quote!( #path(ctx, view); )
quote!( #path(ctx, &view); )
}
})
.collect()
@@ -194,7 +194,11 @@ fn emit_node(node: &RsxNode) -> TokenStream {
let plugins_emit = emit_plugins(plugins);
quote! {
scope.child(#component_expr, Some(std::sync::Arc::new(|ctx, view| {#plugins_emit})));
scope.child(#component_expr, Some(std::sync::Arc::new(|ctx, view| {
let area = ctx.allocate(ctx.area.x, ctx.area.y, ctx.area.width, ctx.area.height);
ctx.draw_view(area, view.clone());
#plugins_emit
})));
}
}
}