mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Fixed pan bug
Since setCanvasOffset is now a method of Layer, it can't be called like a global function.
This commit is contained in:
parent
b6d4544cd8
commit
eedde51ad4
@ -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
|
||||
|
@ -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<layers.length; i++) {
|
||||
layers[i].copyData(layers[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user