Add copy/cut/paste/duplicate functionality for path geometry (#2812)

* Copy and Paste for paths

* Fix merge

* Implement Copy, Cut and Duplicate

* Fix selection of segments

* Fix formatting

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Adesh Gupta
2025-08-02 21:15:01 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 34a8b9b6f1
commit b9a1b2e951
8 changed files with 452 additions and 12 deletions
+8 -1
View File
@@ -629,13 +629,20 @@ impl EditorHandle {
self.dispatch(message);
}
/// Paste layers from a serialized json representation
/// Paste layers from a serialized JSON representation
#[wasm_bindgen(js_name = pasteSerializedData)]
pub fn paste_serialized_data(&self, data: String) {
let message = PortfolioMessage::PasteSerializedData { data };
self.dispatch(message);
}
/// Paste vector data into a new layer from a serialized JSON representation
#[wasm_bindgen(js_name = pasteSerializedVector)]
pub fn paste_serialized_vector(&self, data: String) {
let message = PortfolioMessage::PasteSerializedVector { data };
self.dispatch(message);
}
#[wasm_bindgen(js_name = clipLayer)]
pub fn clip_layer(&self, id: u64) {
let id = NodeId(id);