fix (image): improve image zoom

This commit is contained in:
MickaelK 2025-06-17 20:32:16 +10:00
parent 9332c3b9ef
commit ca68df76ab

View file

@ -47,7 +47,7 @@ function builder({ $img }) {
rxjs.fromEvent($img.parentElement, "wheel").pipe(
rxjs.tap((e) => e.preventDefault()),
rxjs.throttleTime(100, rxjs.animateFrameScheduler),
rxjs.map((e) => ({ scale: Math.exp(-e.deltaY / 300), clientX: e.clientX, clientY: e.clientY })),
rxjs.map((e) => ({ scale: Math.min(Math.exp(-e.deltaY / 300), 2), clientX: e.clientX, clientY: e.clientY })),
),
// zoom via keyboard shortcut
rxjs.fromEvent(window, "keydown").pipe(