Fixed bug when undoing layer add

Also created nAppLayers to save the number of layers used by the editor (and that the use can't directly with).
This commit is contained in:
unsettledgames
2020-09-26 11:51:18 +02:00
parent a205b24742
commit 034715fac8
8 changed files with 31 additions and 12 deletions

View File

@@ -104,7 +104,7 @@ class Layer {
hover() {
// Hide all the layers but the current one
for (let i=1; i<layers.length - 2; i++) {
for (let i=1; i<layers.length - nAppLayers; i++) {
if (layers[i] !== this) {
layers[i].canvas.style.opacity = 0.3;
}
@@ -113,7 +113,7 @@ class Layer {
unhover() {
// Show all the layers again
for (let i=1; i<layers.length - 2; i++) {
for (let i=1; i<layers.length - nAppLayers; i++) {
if (layers[i] !== this) {
layers[i].canvas.style.opacity = 1;
}