Fix layers losing their names upon being grouped (#1637)

* no message

* no message

* no message

* Make layers reserve their names when grouped

* remove redundancy

* replace String::from("") with String::new()

* Fix test

* Restore unrequested line break changes

* Avoid unwraps

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Mohamed Osama
2024-03-02 23:34:25 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 128f76af7e
commit a1f2a2b256
8 changed files with 36 additions and 3 deletions
@@ -427,6 +427,7 @@ fn new_brush_layer(document: &DocumentMessageHandler, responses: &mut VecDeque<M
nodes: HashMap::from([(NodeId(0), brush_node)]),
parent: document.new_layer_parent(),
insert_index: -1,
alias: String::new(),
});
responses.add(NodeGraphMessage::SelectedNodesSet { nodes: vec![id] });
@@ -341,7 +341,13 @@ impl SelectToolData {
let id = NodeId(generate_uuid());
let insert_index = -1;
let layer = LayerNodeIdentifier::new_unchecked(id);
responses.add(GraphOperationMessage::NewCustomLayer { id, nodes, parent, insert_index });
responses.add(GraphOperationMessage::NewCustomLayer {
id,
nodes,
parent,
insert_index,
alias: String::new(),
});
new_dragging.push(layer);
}
let nodes = new_dragging.iter().map(|layer| layer.to_node()).collect();