Fix the Imaginate node from crashing (#1512)

* Allow generic node input for type inference

* Make imaginate resolution picking depend on the image resolution instead of the transform

* Remove dead code

* Fix console spam after crash

* Fix crash when disconnecting Imaginate node input

* Update Imaginate tool tooltip

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
Keavon Chambers
2023-12-12 22:39:33 -08:00
committed by GitHub
co-authored by Dennis Kobert
parent f58aa73edc
commit 83af879a7c
15 changed files with 98 additions and 133 deletions
+2 -9
View File
@@ -2,8 +2,8 @@
//! It serves as a thin wrapper over the editor backend API that relies
//! on the dispatcher messaging system and more complex Rust data types.
use crate::helpers::{translate_key, Error};
use crate::{EDITOR_HAS_CRASHED, EDITOR_INSTANCES, JS_EDITOR_HANDLES};
use crate::helpers::translate_key;
use crate::{Error, EDITOR_HAS_CRASHED, EDITOR_INSTANCES, JS_EDITOR_HANDLES};
use document_legacy::document_metadata::LayerNodeIdentifier;
use document_legacy::LayerId;
@@ -596,13 +596,6 @@ impl JsEditorHandle {
}
}
/// Sends the blob URL generated by JS to the Imaginate layer in the respective document
#[wasm_bindgen(js_name = renderGraphUsingRasterizedRegionBelowLayer)]
pub fn render_graph_using_rasterized_region_below_layer(&self, document_id: u64, layer_path: Vec<LayerId>, _input_image_data: Vec<u8>, _width: u32, _height: u32) {
let message = PortfolioMessage::SubmitGraphRender { document_id, layer_path };
self.dispatch(message);
}
/// Notifies the backend that the user connected a node's primary output to one of another node's inputs
#[wasm_bindgen(js_name = connectNodesByLink)]
pub fn connect_nodes_by_link(&self, output_node: u64, output_node_connector_index: usize, input_node: u64, input_node_connector_index: usize) {