mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 19:08:05 +08:00
Fixes for removing artboards; white infinite canvas background (#1497)
* Fix crash when drawing on a deleted artboard * Fix clear artboards button * White background on no artboards * Re-disable Clear Artboards since it still crashes --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -296,7 +296,6 @@ impl MessageHandler<DocumentMessage, DocumentInputs<'_>> for DocumentMessageHand
|
||||
info!("{:#?}\n{:#?}", self.document_legacy, self.layer_metadata);
|
||||
}
|
||||
DeleteLayer { layer_path } => {
|
||||
responses.add_front(DocumentOperation::DeleteLayer { path: layer_path.clone() });
|
||||
responses.add(GraphOperationMessage::DeleteLayer { id: layer_path[0] });
|
||||
responses.add_front(BroadcastEvent::ToolAbort);
|
||||
responses.add(PropertiesPanelMessage::CheckSelectedWasDeleted { path: layer_path });
|
||||
|
||||
@@ -709,6 +709,7 @@ impl MessageHandler<GraphOperationMessage, (&mut Document, &mut NodeGraphMessage
|
||||
GraphOperationMessage::DeleteLayer { id } => {
|
||||
let mut modify_inputs = ModifyInputsContext::new(document, node_graph, responses);
|
||||
modify_inputs.delete_layer(id);
|
||||
document.load_network_structure();
|
||||
}
|
||||
GraphOperationMessage::ClearArtboards => {
|
||||
let mut modify_inputs = ModifyInputsContext::new(document, node_graph, responses);
|
||||
|
||||
@@ -48,6 +48,10 @@ impl Resize {
|
||||
let Some(layer) = self.layer else {
|
||||
return None;
|
||||
};
|
||||
if !document.network().nodes.contains_key(&layer.to_node()) {
|
||||
self.layer.take();
|
||||
return None;
|
||||
}
|
||||
|
||||
let mut start = self.viewport_drag_start(document);
|
||||
let stop = self.snap_manager.snap_position(responses, document, ipp.mouse.position);
|
||||
|
||||
Reference in New Issue
Block a user