Fix hidden state missing from copy/paste, causing hidden layers to reappear when pasted or grouped (#1698)
Add data state visiblity of node when copy-paste
This commit is contained in:
parent
e9510c5fee
commit
d3e3e19822
|
|
@ -19,6 +19,7 @@ pub const INTERNAL_CLIPBOARD_COUNT: u8 = Clipboard::_InternalClipboardCount as u
|
|||
pub struct CopyBufferEntry {
|
||||
pub nodes: HashMap<NodeId, DocumentNode>,
|
||||
pub selected: bool,
|
||||
pub disabled: bool,
|
||||
pub collapsed: bool,
|
||||
pub alias: String,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
|
|||
)
|
||||
.collect(),
|
||||
selected: active_document.selected_nodes.selected_layers_contains(layer, active_document.metadata()),
|
||||
disabled: !active_document.selected_nodes.layer_visible(layer, active_document.network(), active_document.metadata()),
|
||||
collapsed: false,
|
||||
alias: previous_alias,
|
||||
});
|
||||
|
|
@ -387,6 +388,9 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
|
|||
if entry.selected {
|
||||
responses.add(NodeGraphMessage::SelectedNodesAdd { nodes: vec![id] });
|
||||
}
|
||||
if entry.disabled {
|
||||
responses.add(NodeGraphMessage::SetHidden { node_id: id, hidden: entry.disabled });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -415,6 +419,9 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
|
|||
if entry.selected {
|
||||
responses.add(NodeGraphMessage::SelectedNodesAdd { nodes: vec![id] });
|
||||
}
|
||||
if entry.disabled {
|
||||
responses.add(NodeGraphMessage::SetHidden { node_id: id, hidden: entry.disabled });
|
||||
}
|
||||
}
|
||||
|
||||
responses.add(DocumentMessage::CommitTransaction);
|
||||
|
|
|
|||
Loading…
Reference in New Issue