mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-08 00:05:00 +00:00
Fix graph compile error handling
This commit is contained in:
parent
d69cbc7dee
commit
ec4bab1a2b
6 changed files with 14 additions and 6 deletions
|
@ -2065,7 +2065,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
|||
DocumentNode {
|
||||
manual_composition: Some(concrete!(Footprint)),
|
||||
inputs: vec![NodeInput::node(NodeId(1), 0)],
|
||||
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::memo::ImpureMemoNode<_, _, _>")),
|
||||
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::memo::MemoNode<_, _>")),
|
||||
..Default::default()
|
||||
},
|
||||
]
|
||||
|
|
|
@ -612,6 +612,11 @@ impl NodeGraphExecutor {
|
|||
document.network_interface.document_metadata_mut().update_from_monitor(HashMap::new(), HashMap::new());
|
||||
log::trace!("{e}");
|
||||
|
||||
responses.add(NodeGraphMessage::UpdateTypes {
|
||||
resolved_types: ResolvedDocumentNodeTypesDelta::default(),
|
||||
node_graph_errors,
|
||||
});
|
||||
responses.add(NodeGraphMessage::SendGraph);
|
||||
return Err("Node graph evaluation failed".to_string());
|
||||
}
|
||||
Ok(result) => result,
|
||||
|
|
|
@ -232,8 +232,9 @@ async fn construct_artboard(
|
|||
let intersection = viewport_bounds.intersect(&artboard_bounds);
|
||||
let offset = intersection.start;
|
||||
let scale = footprint.scale();
|
||||
let intersection = intersection.transformed(footprint.transform);
|
||||
// let intersection = intersection.transformed(footprint.transform);
|
||||
let resolution = (scale * intersection.size()).as_uvec2();
|
||||
log::debug!("intersection: {intersection:?}");
|
||||
log::debug!("offset: {offset:?}, resolution: {resolution:?}");
|
||||
|
||||
if clip {
|
||||
|
|
|
@ -656,15 +656,17 @@ fn noise_pattern(
|
|||
|
||||
// If the image would not be visible, return an empty image
|
||||
if size.x <= 0. || size.y <= 0. {
|
||||
log::debug!("empty size, aborting");
|
||||
return ImageFrame::empty();
|
||||
}
|
||||
|
||||
let footprint_scale = footprint.scale();
|
||||
let width = (size.x * footprint_scale.x) as u32;
|
||||
let height = (size.y * footprint_scale.y) as u32;
|
||||
log::debug!("resolution: {:?}", footprint.resolution());
|
||||
let width = footprint.resolution().x;
|
||||
let height = footprint.resolution().y;
|
||||
log::debug!("w: {width} h: {height}");
|
||||
// log::debug!("resolution: {:?}", footprint.resolution());
|
||||
// let width = footprint.resolution().x;
|
||||
// let height = footprint.resolution().y;
|
||||
|
||||
// All
|
||||
let mut image = Image::new(width, height, Color::from_luminance(0.5));
|
||||
|
|
|
@ -126,7 +126,6 @@ async fn render_canvas(render_config: RenderConfig, data: impl GraphicElementRen
|
|||
// TODO: Instead of applying the transform here, pass the transform during the translation to avoid the O(Nr cost
|
||||
scene.append(&child, Some(kurbo::Affine::new(footprint.transform.to_cols_array())));
|
||||
let resolution = footprint.resolution();
|
||||
log::debug!("rendering using resolution: {resolution:?}");
|
||||
|
||||
exec.render_vello_scene(&scene, &surface_handle, resolution.x, resolution.y, &context)
|
||||
.await
|
||||
|
|
|
@ -621,6 +621,7 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
|
|||
async_node!(graphene_core::memo::MemoNode<_, _>, input: (), output: RenderOutput, params: [RenderOutput]),
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Footprint, output: Image<Color>, fn_params: [Footprint => Image<Color>]),
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Footprint, output: ImageFrame<Color>, fn_params: [Footprint => ImageFrame<Color>]),
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Footprint, output: TextureFrame, fn_params: [Footprint => TextureFrame]),
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Footprint, output: QuantizationChannels, fn_params: [Footprint => QuantizationChannels]),
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Footprint, output: Vec<DVec2>, fn_params: [Footprint => Vec<DVec2>]),
|
||||
async_node!(graphene_core::memo::MemoNode<_, _>, input: Footprint, output: Arc<WasmSurfaceHandle>, fn_params: [Footprint => Arc<WasmSurfaceHandle>]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue