Typescript

This commit is contained in:
Mitchell McCaffrey
2021-07-17 17:25:41 +10:00
parent 97734a2f55
commit 2a053f4854
33 changed files with 412 additions and 419 deletions

View File

@@ -26,7 +26,7 @@ import {
const defaultNoteSize = 2;
type MapNoteProps = {
map: Map;
map: Map | null;
active: boolean;
onNoteAdd: NoteAddEventHander;
onNoteChange: NoteChangeEventHandler;
@@ -75,7 +75,7 @@ function MapNotes({
if (!position) {
return;
}
if (map.snapToGrid) {
if (map?.snapToGrid) {
position = snapPositionToGrid(position);
}
return Vector2.divide(position, {