Remove most of document-legacy (#1519)

* Remove boolean ops and unused doc-legacy Operations

* Remove Shape legacy layers

* Remove legacy layer Properties panel code

* Remove additional unused doc-legacy Operations

* Removed unused rendering-related legacy-layer code

* Upgrade dep so CI builds

* Remove various additional unused functions and messages

* Remove the LayerData trait

* Remove RenderData struct and usages

* Banish the Operations system

* Further removals
This commit is contained in:
Keavon Chambers
2023-12-19 04:36:19 -08:00
parent c42d030f18
commit 9a7d7de8fa
64 changed files with 330 additions and 5868 deletions
+19 -26
View File
@@ -1,12 +1,13 @@
//! This file is where functions are defined to be called directly from JS.
//! It serves as a thin wrapper over the editor backend API that relies
//! on the dispatcher messaging system and more complex Rust data types.
#[allow(clippy::too_many_arguments)]
#[allow(clippy::non_snake_case)]
// This file is where functions are defined to be called directly from JS.
// 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;
use crate::{Error, EDITOR_HAS_CRASHED, EDITOR_INSTANCES, JS_EDITOR_HANDLES};
use document_legacy::document::LayerId;
use document_legacy::document_metadata::LayerNodeIdentifier;
use document_legacy::LayerId;
use editor::application::generate_uuid;
use editor::application::Editor;
use editor::consts::{FILE_SAVE_SUFFIX, GRAPHITE_DOCUMENT_VERSION};
@@ -103,7 +104,6 @@ async fn poll_node_graph_evaluation() {
}
#[wasm_bindgen]
#[allow(clippy::too_many_arguments)]
impl JsEditorHandle {
#[wasm_bindgen(constructor)]
pub fn new(frontend_message_handler_callback: js_sys::Function) -> Self {
@@ -575,26 +575,19 @@ impl JsEditorHandle {
self.dispatch(message);
}
/// Sends the blob URL generated by JS to the Image layer
#[wasm_bindgen(js_name = setImageBlobURL)]
pub fn set_image_blob_url(&self, document_id: u64, layer_path: Vec<LayerId>, node_id: Option<NodeId>, blob_url: String, width: f64, height: f64, transform: Option<js_sys::Float64Array>) {
let resolution = (width, height);
let message = PortfolioMessage::SetImageBlobUrl {
document_id,
layer_path: layer_path.clone(),
node_id,
blob_url,
resolution,
};
self.dispatch(message);
if let Some(array) = transform.filter(|array| array.length() == 6) {
let mut transform: [f64; 6] = [0.; 6];
array.copy_to(&mut transform);
let message = document_legacy::Operation::SetLayerTransform { path: layer_path, transform };
self.dispatch(message);
}
}
// /// Sends the blob URL generated by JS to the Image layer
// #[wasm_bindgen(js_name = setImageBlobURL)]
// pub fn set_image_blob_url(&self, document_id: u64, layer_path: Vec<LayerId>, node_id: Option<NodeId>, blob_url: String, width: f64, height: f64, _transform: Option<js_sys::Float64Array>) {
// let resolution = (width, height);
// let message = PortfolioMessage::SetImageBlobUrl {
// document_id,
// layer_path: layer_path.clone(),
// node_id,
// blob_url,
// resolution,
// };
// 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)]