mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-27 12:26:29 -08:00
changed it to zoom to fit to container initially regardless of size sinze with the button its easy to get to the natural size, and it helps for sending pixelart
This commit is contained in:
1 parent
b3c4edcead
commit
fde563e46e
1 file changed
+1
-1
@@ -236,7 +236,7 @@ export const useImageGestures = (active: boolean, step = 0.2, min = 0.1, max = 5
|
||||
}
|
||||
const heightRatio = height / img.naturalHeight;
|
||||
const widthRatio = width / img.naturalWidth;
|
||||
const fitZoom = Math.min(heightRatio, widthRatio, 1);
|
||||
const fitZoom = Math.min(heightRatio, widthRatio);
|
||||
|
||||
img.style.transition = 'none';
|
||||
setFitRatio(fitZoom);
|
||||
|
||||
Reference in new issue
Block a user