mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
fixed a few bugs on layers before first document is created
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user