This commit is contained in:
Nicola
2021-12-11 12:48:12 +01:00
parent a238fb1b47
commit 1bac62be4c
5 changed files with 14 additions and 30 deletions

View File

@ -186,23 +186,16 @@ class Layer {
this.canvas.style.top = otherLayer.canvas.style.top;
}
selectLayer(layer) {
if (layer == null) {
// Deselecting the old layer
currFile.currentLayer.deselectLayer();
selectLayer(hideOptions = true) {
if (hideOptions)
LayerList.closeOptionsMenu();
// Deselecting the old layer
currFile.currentLayer.deselectLayer();
// Selecting the current layer
this.isSelected = true;
this.menuEntry.classList.add("selected-layer");
currFile.currentLayer = LayerList.getLayerByName(this.menuEntry.getElementsByTagName("p")[0].innerHTML);
}
else {
currFile.currentLayer.deselectLayer();
layer.isSelected = true;
layer.menuEntry.classList.add("selected-layer");
currFile.currentLayer = layer;
}
// Selecting the current layer
this.isSelected = true;
this.menuEntry.classList.add("selected-layer");
currFile.currentLayer = this;
}
toggleLock() {