Fixed invisible cursor outside of canvas

This commit is contained in:
unsettledgames 2021-06-30 22:47:45 +02:00
parent 1a69b48297
commit d7b04d7699
2 changed files with 9 additions and 4 deletions

View File

@ -354,7 +354,7 @@ svg {
left: 64px; left: 64px;
right: 48px; right: 48px;
top: 48px; top: 48px;
cursor: none; cursor: default;
position: fixed; position: fixed;
display: block; display: block;
} }

View File

@ -32,8 +32,6 @@ window.addEventListener("mousedown", function (mouseEvent) {
} }
} }
currentTool.updateCursor();
if (!currentLayer.isLocked && !currentLayer.isVisible && canDraw) { if (!currentLayer.isLocked && !currentLayer.isVisible && canDraw) {
draw(mouseEvent); draw(mouseEvent);
} }
@ -420,6 +418,13 @@ function draw (mouseEvent) {
currentLayer.updateLayerPreview(); currentLayer.updateLayerPreview();
} }
} }
if (mouseEvent.target.className == 'drawingCanvas')
currentTool.updateCursor();
else
canvasView.style.cursor = 'default';
console.log("Cursor: " + canvasView.style.cursor);
} }
//mousewheel scroll //mousewheel scroll