Fixed canvas resizing bug

The canvas size was not being updated after opening a png
This commit is contained in:
unsettledgames
2020-09-22 11:34:36 +02:00
parent 93c73f939c
commit b595026ea8
5 changed files with 36 additions and 8 deletions

View File

@ -39,7 +39,12 @@ function newPixel (width, height, editorMode, fileContent = null) {
layers[1] = new Layer(width, height, layers[1].canvas, layers[1].menuEntry);
currentLayer = layers[1];
currentLayer.canvas.style.zIndex = 2;
currentLayer.canvas.style.zIndex = 2;
// Updating canvas size
for (let i=0; i<nLayers; i++) {
layers[i].canvasSize = [width, height];
}
}
// Adding the checkerboard behind it