Skip to content

Commit fe2a4f3

Browse files
Integrates invoke-ai#1487 - touch events
Need to add: - Pinch zoom - Touch-specific handling (some things aren't quite right)
1 parent 1990b60 commit fe2a4f3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

frontend/src/features/canvas/components/IAICanvas.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ const IAICanvas = () => {
149149
width={stageDimensions.width}
150150
height={stageDimensions.height}
151151
scale={{ x: stageScale, y: stageScale }}
152+
onTouchStart={handleMouseDown}
153+
onTouchMove={handleMouseMove}
154+
onTouchEnd={handleMouseUp}
152155
onMouseDown={handleMouseDown}
153156
onMouseEnter={handleMouseEnter}
154157
onMouseLeave={handleMouseOut}

frontend/src/features/canvas/hooks/useCanvasMouseDown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const useCanvasMouseDown = (stageRef: MutableRefObject<Konva.Stage | null>) => {
3131
const { tool, isStaging } = useAppSelector(selector);
3232

3333
return useCallback(
34-
(e: KonvaEventObject<MouseEvent>) => {
34+
(e: KonvaEventObject<MouseEvent | TouchEvent>) => {
3535
if (!stageRef.current) return;
3636

3737
stageRef.current.container().focus();

0 commit comments

Comments
 (0)