mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user