Add basic selection movement

This commit is contained in:
Mitchell McCaffrey
2021-07-21 18:56:18 +10:00
parent 20f48f173e
commit 4cee11d5ea
9 changed files with 311 additions and 60 deletions
+5
View File
@@ -58,3 +58,8 @@ export type StreamEndEventHandler = (stream: MediaStream) => void;
export type TimerStartEventHandler = (event: Timer) => void;
export type TimerStopEventHandler = () => void;
export type SelectionItemsChangeEventHandler = (
tokenChanges: Record<string, Partial<TokenState>>,
noteChanges: Record<string, Partial<Note>>
) => void;
+10 -2
View File
@@ -1,4 +1,3 @@
import Konva from "konva";
import { RectData, PointsData } from "./Drawing";
export type SelectToolType = "path" | "rectangle";
@@ -7,8 +6,17 @@ export type SelectToolSettings = {
type: SelectToolType;
};
export type SelectionItemType = "token" | "note";
export type SelectionItem = {
type: SelectionItemType;
id: string;
};
export type BaseSelection = {
nodes: Konva.Node[];
items: SelectionItem[];
x: number;
y: number;
};
export type RectSelection = BaseSelection & {