mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-30 13:52:44 -08:00
added small qol changes
This commit is contained in:
1 parent
21ecfe4472
commit
b3c4edcead
4 files changed
+6
-4
No files matched your search
@@ -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}
|
||||
|
||||
@@ -7,6 +7,7 @@ export const Image = style([
|
||||
objectFit: 'contain',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
imageRendering: 'pixelated',
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in new issue
Block a user