Fix Layers panel UI not updating on selection change and expand/collapsing (#1847)
Also fixes a panic on empty layer. * Fix layer properties updete on layer change + fix panic on empty layer * Fix Layers panel expand/collapse --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
fad289804a
commit
ab8748627d
|
|
@ -46,7 +46,7 @@ const DEBUG_MESSAGE_BLOCK_LIST: &[MessageDiscriminant] = &[
|
||||||
MessageDiscriminant::InputPreprocessor(InputPreprocessorMessageDiscriminant::FrameTimeAdvance),
|
MessageDiscriminant::InputPreprocessor(InputPreprocessorMessageDiscriminant::FrameTimeAdvance),
|
||||||
];
|
];
|
||||||
// TODO: Find a way to combine these with the list above. We use strings for now since these are the standard variant names used by multiple messages. But having these also type-checked would be best.
|
// TODO: Find a way to combine these with the list above. We use strings for now since these are the standard variant names used by multiple messages. But having these also type-checked would be best.
|
||||||
const DEBUG_MESSAGE_ENDING_BLOCK_LIST: &[&str] = &["PointerMove", "PointerOutsideViewport"];
|
const DEBUG_MESSAGE_ENDING_BLOCK_LIST: &[&str] = &["PointerMove", "PointerOutsideViewport", "Overlays", "Draw"];
|
||||||
|
|
||||||
impl Dispatcher {
|
impl Dispatcher {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
|
|
|
||||||
|
|
@ -1015,7 +1015,7 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
|
||||||
} else {
|
} else {
|
||||||
self.collapsed.0.push(layer);
|
self.collapsed.0.push(layer);
|
||||||
}
|
}
|
||||||
responses.add(NodeGraphMessage::RunDocumentGraph);
|
responses.add(NodeGraphMessage::SendGraph);
|
||||||
}
|
}
|
||||||
DocumentMessage::ToggleGridVisibility => {
|
DocumentMessage::ToggleGridVisibility => {
|
||||||
self.snapping_state.grid_snapping = !self.snapping_state.grid_snapping;
|
self.snapping_state.grid_snapping = !self.snapping_state.grid_snapping;
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphHandlerData<'a>> for NodeGrap
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
responses.add(ArtboardToolMessage::UpdateSelectedArtboard);
|
responses.add(ArtboardToolMessage::UpdateSelectedArtboard);
|
||||||
|
responses.add(DocumentMessage::DocumentStructureChanged);
|
||||||
responses.add(NodeGraphMessage::RunDocumentGraph);
|
responses.add(NodeGraphMessage::RunDocumentGraph);
|
||||||
}
|
}
|
||||||
NodeGraphMessage::ConnectNodesByWire {
|
NodeGraphMessage::ConnectNodesByWire {
|
||||||
|
|
|
||||||
|
|
@ -441,6 +441,9 @@ impl Fsm for SelectToolFsmState {
|
||||||
.next()
|
.next()
|
||||||
.map(|layer| document.metadata().transform_to_viewport(layer));
|
.map(|layer| document.metadata().transform_to_viewport(layer));
|
||||||
let transform = transform.unwrap_or(DAffine2::IDENTITY);
|
let transform = transform.unwrap_or(DAffine2::IDENTITY);
|
||||||
|
if transform.matrix2.determinant() == 0. {
|
||||||
|
return self;
|
||||||
|
}
|
||||||
let bounds = document
|
let bounds = document
|
||||||
.selected_nodes
|
.selected_nodes
|
||||||
.selected_visible_and_unlocked_layers(document.metadata())
|
.selected_visible_and_unlocked_layers(document.metadata())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue