added small qol changes

This commit is contained in:
Shea Duma committed 2026-05-14 16:02:25 +03:00
1 parent 21ecfe4472
commit b3c4edcead
4 files changed
+6 -4

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ export const PdfViewer = as<'div', PdfViewerProps>(
zoomOut,
setZoom,
onPointerDown,
} = useImageGestures(true, 0.2);
} = useImageGestures(true, 0.2, 0.1, 5);
const [pdfJSState, loadPdfJS] = usePdfJSLoader();
const [docState, loadPdfDocument] = usePdfDocumentLoader(
@@ -35,7 +35,7 @@ export const ImageViewer = as<'div', ImageViewerProps>(
containerRef,
handleImageLoad,
enableResizeWithWindow,
} = useImageGestures(true, 0.2, 0.1, 5);
} = useImageGestures(true, 0.2, 0.1);
useEffect(() => {
setIsImageReady(false);
enableResizeWithWindow();
@@ -213,7 +213,8 @@ export const ImageViewer = as<'div', ImageViewerProps>(
data-gestures="ignore"
justifyContent="Center"
alignItems="Center"
style={{ overflow: 'hidden', touchAction: 'none' }}
style={{ overflow: 'hidden', touchAction: 'none', cursor }}
onPointerDown={onPointerDown}
>
<img
className={css.ImageViewerImg}
+1
View File
@@ -7,6 +7,7 @@ export const Image = style([
objectFit: 'contain',
width: '100%',
height: '100%',
imageRendering: 'pixelated',
},
]);
+1 -1
View File
@@ -21,7 +21,7 @@ function getCursorOffsetFromImageCenter(
};
}
export const useImageGestures = (active: boolean, step = 0.2, min = 0.1, max = 5) => {
export const useImageGestures = (active: boolean, step = 0.2, min = 0.1, max = 500) => {
const [transforms, setTransforms] = useState({
zoom: 1,
pan: { x: 0, y: 0 },