fixed a few bugs on layers before first document is created

This commit is contained in:
Sam Keddy
2020-09-09 04:15:22 +00:00
parent 8a769557db
commit 43f5fa8d5c
3 changed files with 44 additions and 28 deletions

View File

@ -5,7 +5,6 @@ function newPixel (width, height, editorMode, fileContent = null) {
currentPalette = [];
if (firstPixel) {
layerList = document.getElementById("layers-menu");
layerListEntry = layerList.firstElementChild;
// Setting up the current layer
@ -58,7 +57,7 @@ function newPixel (width, height, editorMode, fileContent = null) {
canvasSize = currentLayer.canvasSize;
if (firstPixel) {
// Cloning the entry so that when I change something on the first layer, those changes aren't
// Cloning the entry so that when I change something on the first layer, those changes aren't
// propagated to the other ones
layerListEntry = layerListEntry.cloneNode(true);
// Adding the first layer and the checkerboard to the list of layers
@ -142,7 +141,7 @@ function newPixel (width, height, editorMode, fileContent = null) {
if (i == (fileContent['nLayers'] - 1)) {
createPaletteFromLayers();
}
};
};
img.src = layerImage;