Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the layer tree show duplicate branches where they are used multiple times in the graph #2217

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl LayerNodeIdentifier {

/// Add a child towards the bottom of the Layers panel
pub fn push_child(self, metadata: &mut DocumentMetadata, new: LayerNodeIdentifier) {
assert!(!metadata.structure.contains_key(&new), "Cannot add already existing layer");
//assert!(!metadata.structure.contains_key(&new), "Cannot add already existing layer");
let parent = metadata.get_structure_mut(self);
let old_last_child = parent.last_child.replace(new);
parent.first_child.get_or_insert(new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3177,28 +3177,24 @@ impl NodeNetworkInterface {
for current_node_id in horizontal_flow_iter {
if self.is_layer(&current_node_id, &[]) {
let current_layer_node = LayerNodeIdentifier::new(current_node_id, self, &[]);
if !self.document_metadata.structure.contains_key(&current_layer_node) {
if current_node_id == first_root_layer.to_node() {
awaiting_primary_flow.push((current_node_id, LayerNodeIdentifier::ROOT_PARENT));
children.push((LayerNodeIdentifier::ROOT_PARENT, current_layer_node));
} else {
awaiting_primary_flow.push((current_node_id, parent_layer_node));
children.push((parent_layer_node, current_layer_node));
}
parent_layer_node = current_layer_node;
if current_node_id == first_root_layer.to_node() {
awaiting_primary_flow.push((current_node_id, LayerNodeIdentifier::ROOT_PARENT));
children.push((LayerNodeIdentifier::ROOT_PARENT, current_layer_node));
} else {
awaiting_primary_flow.push((current_node_id, parent_layer_node));
children.push((parent_layer_node, current_layer_node));
}
parent_layer_node = current_layer_node;
}
}
} else {
// Skip the horizontal_root_node_id node
for current_node_id in horizontal_flow_iter.skip(1) {
if self.is_layer(&current_node_id, &[]) {
let current_layer_node = LayerNodeIdentifier::new(current_node_id, self, &[]);
if !self.document_metadata.structure.contains_key(&current_layer_node) {
awaiting_primary_flow.push((current_node_id, parent_layer_node));
children.push((parent_layer_node, current_layer_node));
parent_layer_node = current_layer_node;
}
awaiting_primary_flow.push((current_node_id, parent_layer_node));
children.push((parent_layer_node, current_layer_node));
parent_layer_node = current_layer_node;
}
}
}
Expand All @@ -3215,12 +3211,10 @@ impl NodeNetworkInterface {
if self.is_layer(&current_node_id, &[]) {
// Create a new layer for the top of each stack, and add it as a child to the previous parent
let current_layer_node = LayerNodeIdentifier::new(current_node_id, self, &[]);
if !self.document_metadata.structure.contains_key(&current_layer_node) {
children.push(current_layer_node);
children.push(current_layer_node);

// The layer nodes for the horizontal flow is itself
awaiting_horizontal_flow.push((current_node_id, current_layer_node));
}
// The layer nodes for the horizontal flow is itself
awaiting_horizontal_flow.push((current_node_id, current_layer_node));
}
}
for child in children {
Expand Down
Loading