refactor(web): split touch canvas adapters

This commit is contained in:
2026-04-01 11:09:26 +02:00
parent a4789d718b
commit 922394c56a
7 changed files with 114 additions and 58 deletions
-23
View File
@@ -9,15 +9,6 @@ export type TouchDecisionState = {
decided: boolean;
};
export type TouchMouseDownEvent = {
button: number;
clientX: number;
currentTarget?: EventTarget | null;
shiftKey: boolean;
preventDefault: () => void;
stopPropagation: () => void;
};
type TouchLike = {
clientX: number;
clientY: number;
@@ -36,20 +27,6 @@ export function getTouchPoint(event: TouchEventLike): TouchPoint {
};
}
export function createTouchMouseDownEvent(
point: TouchPoint,
currentTarget?: EventTarget | null,
): TouchMouseDownEvent {
return {
button: 0,
clientX: point.clientX,
currentTarget: currentTarget ?? null,
shiftKey: false,
preventDefault: () => {},
stopPropagation: () => {},
};
}
export function resolveTouchDragDecision(
state: TouchDecisionState,
point: TouchPoint,