From eedde51ad4e6f715564c3873ec512bb9af4b7232 Mon Sep 17 00:00:00 2001 From: unsettledgames <47360416+unsettledgames@users.noreply.github.com> Date: Fri, 18 Sep 2020 10:26:56 +0200 Subject: [PATCH] Fixed pan bug Since setCanvasOffset is now a method of Layer, it can't be called like a global function. --- README.md | 1 - js/_mouseEvents.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index d9b0ca3..005793f 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,6 @@ Suggestions / Planned features: - Polish: - Show colors which would need to be added to palette - Warning windows for wrong inputs - - Hide non-hovered layers - Palette option remove unused colors - Move selection with arrows - Update pivot buttons when resizing canvas diff --git a/js/_mouseEvents.js b/js/_mouseEvents.js index de0a386..124b18a 100644 --- a/js/_mouseEvents.js +++ b/js/_mouseEvents.js @@ -259,7 +259,7 @@ function draw (mouseEvent) { } else if (currentTool.name == 'pan' && dragging) { // Setting first layer position - setCanvasOffset(layers[0].canvas, layers[0].canvas.offsetLeft + (cursorLocation[0] - lastMouseClickPos[0]), layers[0].canvas.offsetTop + (cursorLocation[1] - lastMouseClickPos[1])); + layers[0].setCanvasOffset(layers[0].canvas.offsetLeft + (cursorLocation[0] - lastMouseClickPos[0]), layers[0].canvas.offsetTop + (cursorLocation[1] - lastMouseClickPos[1])); // Copying that position to the other layers for (let i=1; i