Added history states for canvas resizing

Must fix bug that happens when creating a new layer after resizing the canvas
This commit is contained in:
unsettledgames
2020-09-15 13:06:31 +02:00
parent 663b714b46
commit b7d5f603b1
6 changed files with 71 additions and 12 deletions

View File

@ -12,8 +12,8 @@ function getCursorPosition(e) {
y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
x -= canvas.offsetLeft;
y -= canvas.offsetTop;
x -= currentLayer.canvas.offsetLeft;
y -= currentLayer.canvas.offsetTop;
return [Math.round(x), Math.round(y)];
}