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

@@ -184,8 +184,8 @@ class Layer {
setCanvasOffset (offsetLeft, offsetTop) {
//horizontal offset
var minXOffset = -this.canvasSize[0] * zoom + 300;
var maxXOffset = window.innerWidth - 148;
var minXOffset = -this.canvasSize[0] * zoom;
var maxXOffset = window.innerWidth - 300;
if (offsetLeft < minXOffset)
this.canvas.style.left = minXOffset +'px';