MCPcopy Create free account
hub / github.com/Sethispr/image-compressor / onPointerMove

Function onPointerMove

components/ComparisonModal.tsx:113–132  ·  view source on GitHub ↗
(e: React.PointerEvent)

Source from the content-addressed store, hash-verified

111 };
112
113 const onPointerMove = (e: React.PointerEvent) => {
114 if (!isDragging) return;
115 e.preventDefault();
116
117 const dx = e.clientX - lastPoint.current.x;
118 const dy = e.clientY - lastPoint.current.y;
119 lastPoint.current = {x: e.clientX, y: e.clientY};
120
121 if (interactionMode.current === 'pan') {
122 setTransform(prev => ({
123 ...prev,
124 x: prev.x + dx,
125 y: prev.y + dy,
126 }));
127 } else if (interactionMode.current === 'slide') {
128 const screenWidth = window.innerWidth;
129 const deltaPct = (dx / screenWidth) * 100;
130 setSliderPos(prev => Math.max(0, Math.min(100, prev + deltaPct)));
131 }
132 };
133
134 const onPointerUp = (e: React.PointerEvent) => {
135 setIsDragging(false);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected