Probably fixed #19

This commit is contained in:
unsettledgames 2020-09-16 13:08:44 +02:00
parent 267d1a170e
commit f5c4b68125
2 changed files with 4 additions and 5 deletions

View File

@ -76,12 +76,13 @@ class Layer {
// Initializes the canvas // Initializes the canvas
initialize() { initialize() {
/*
var maxHorizontalZoom = Math.floor(window.innerWidth/this.canvasSize[0]*0.75); var maxHorizontalZoom = Math.floor(window.innerWidth/this.canvasSize[0]*0.75);
var maxVerticalZoom = Math.floor(window.innerHeight/this.canvasSize[1]*0.75); var maxVerticalZoom = Math.floor(window.innerHeight/this.canvasSize[1]*0.75);
zoom = Math.min(maxHorizontalZoom,maxVerticalZoom); zoom = Math.min(maxHorizontalZoom,maxVerticalZoom);
if (zoom < 1) zoom = 1; if (zoom < 1) zoom = 1;
*/
//resize canvas //resize canvas
this.canvas.width = this.canvasSize[0]; this.canvas.width = this.canvasSize[0];
this.canvas.height = this.canvasSize[1]; this.canvas.height = this.canvasSize[1];
@ -584,8 +585,6 @@ function addLayer(id, saveHistory = true) {
newCanvas.style.zIndex = maxZIndex; newCanvas.style.zIndex = maxZIndex;
newCanvas.classList.add("drawingCanvas"); newCanvas.classList.add("drawingCanvas");
console.log("Tela creata: " + newCanvas);
if (!layerListEntry) return console.warn('skipping adding layer because no document'); if (!layerListEntry) return console.warn('skipping adding layer because no document');
// Clone the default layer // Clone the default layer
@ -604,7 +603,6 @@ function addLayer(id, saveHistory = true) {
layers.splice(index, 0, newLayer); layers.splice(index, 0, newLayer);
// Insert it before the Add layer button // Insert it before the Add layer button
layerList.insertBefore(toAppend, layerList.childNodes[0]); layerList.insertBefore(toAppend, layerList.childNodes[0]);

View File

@ -1,5 +1,6 @@
//init variables //init variables
var canvasSize,zoom; var canvasSize;
var zoom = 3;
var dragging = false; var dragging = false;
var lastMouseClickPos = [0,0]; var lastMouseClickPos = [0,0];
var dialogueOpen = false; var dialogueOpen = false;