Fix note crash when selecting pan tool

This commit is contained in:
Mitchell McCaffrey
2020-11-27 12:23:57 +11:00
parent 9fa8667081
commit 19d44f3f79
2 changed files with 24 additions and 17 deletions

View File

@@ -69,13 +69,15 @@ function MapNotes({
}
function handleBrushMove() {
const brushPosition = getBrushPosition();
setNoteData((prev) => ({
...prev,
x: brushPosition.x,
y: brushPosition.y,
}));
setIsBrushDown(true);
if (noteData) {
const brushPosition = getBrushPosition();
setNoteData((prev) => ({
...prev,
x: brushPosition.x,
y: brushPosition.y,
}));
setIsBrushDown(true);
}
}
function handleBrushUp() {