Artboard history (#976)

* Convert DocumentSave to struct

* Comit the artboard history save in some cases

* Cause index out of bounds error

* Use box to avoid weird wasm error

* Implement the artboard history

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2023-01-22 11:51:08 -08:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent f0705a46fd
commit ae445f6c64
5 changed files with 41 additions and 24 deletions
@@ -190,6 +190,8 @@ impl Fsm for ArtboardToolFsmState {
};
if let Some(selected_edges) = dragging_bounds {
responses.push_back(DocumentMessage::StartTransaction.into());
let snap_x = selected_edges.2 || selected_edges.3;
let snap_y = selected_edges.0 || selected_edges.1;
@@ -206,6 +208,7 @@ impl Fsm for ArtboardToolFsmState {
ArtboardToolFsmState::ResizingBounds
} else {
responses.push_back(DocumentMessage::StartTransaction.into());
let tolerance = DVec2::splat(SELECTION_TOLERANCE);
let quad = Quad::from_box([input.mouse.position - tolerance, input.mouse.position + tolerance]);
let intersection = document.artboard_message_handler.artboards_document.intersects_quad_root(quad, font_cache);