This commit is contained in:
vcoppe committed 2026-10-08 21:04:29 +02:00
1 parent b085a1d476
commit 42a55e6759
51 files changed
+5756 -3854

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
//! Undo and redo.
use gpx_engine::Action;
use wasm_bindgen::prelude::*;
use crate::ts::Outcome;
use crate::session::*;
// Undo-redo
#[wasm_bindgen]
pub fn undo() -> Outcome {
execute(Action::Undo)
}
#[wasm_bindgen]
pub fn redo() -> Outcome {
execute(Action::Redo)
}
#[wasm_bindgen]
pub fn can_undo() -> bool {
with_engine(|e| e.can_undo()).unwrap_or(false)
}
#[wasm_bindgen]
pub fn can_redo() -> bool {
with_engine(|e| e.can_redo()).unwrap_or(false)
}