mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-08 00:05:00 +00:00
Improve node macro and add more diagnostics (#1999)
* Improve node macro ergonomics * Fix type error in stub import * Fix wasm nodes * Code review --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
3eb98c6d6d
commit
cd4124a596
15 changed files with 358 additions and 122 deletions
|
@ -133,7 +133,7 @@ async fn render_canvas(render_config: RenderConfig, data: impl GraphicElementRen
|
|||
#[cfg(target_arch = "wasm32")]
|
||||
async fn rasterize<T: GraphicElementRendered + graphene_core::transform::TransformMut + WasmNotSend + 'n>(
|
||||
_: (),
|
||||
#[implementations((Footprint, VectorData), (Footprint, ImageFrame<Color>), (Footprint, GraphicGroup))] data: impl Node<Footprint, Output = T>,
|
||||
#[implementations(Footprint -> VectorData, Footprint -> ImageFrame<Color>, Footprint -> GraphicGroup)] data: impl Node<Footprint, Output = T>,
|
||||
footprint: Footprint,
|
||||
surface_handle: Arc<SurfaceHandle<HtmlCanvasElement>>,
|
||||
) -> ImageFrame<Color> {
|
||||
|
@ -190,17 +190,17 @@ async fn render<'a: 'n, T: 'n + GraphicElementRendered + WasmNotSend>(
|
|||
render_config: RenderConfig,
|
||||
editor_api: &'a WasmEditorApi,
|
||||
#[implementations(
|
||||
(Footprint, VectorData),
|
||||
(Footprint, ImageFrame<Color>),
|
||||
(Footprint, GraphicGroup),
|
||||
(Footprint, graphene_core::Artboard),
|
||||
(Footprint, graphene_core::ArtboardGroup),
|
||||
(Footprint, Option<Color>),
|
||||
(Footprint, Vec<Color>),
|
||||
(Footprint, bool),
|
||||
(Footprint, f32),
|
||||
(Footprint, f64),
|
||||
(Footprint, String),
|
||||
Footprint -> VectorData,
|
||||
Footprint -> ImageFrame<Color>,
|
||||
Footprint -> GraphicGroup,
|
||||
Footprint -> graphene_core::Artboard,
|
||||
Footprint -> graphene_core::ArtboardGroup,
|
||||
Footprint -> Option<Color>,
|
||||
Footprint -> Vec<Color>,
|
||||
Footprint -> bool,
|
||||
Footprint -> f32,
|
||||
Footprint -> f64,
|
||||
Footprint -> String,
|
||||
)]
|
||||
data: impl Node<Footprint, Output = T>,
|
||||
_surface_handle: impl Node<(), Output = Option<wgpu_executor::WgpuSurface>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue