From ef33caa71e6e7c97cd068ec554ce3f95a606863a Mon Sep 17 00:00:00 2001 From: Elliott <85990359+Ell1ott@users.noreply.github.com> Date: Mon, 19 Feb 2024 16:53:01 +0100 Subject: [PATCH 1/2] fix event types --- src/routes/workspace/editor/FileEditor.svelte | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/routes/workspace/editor/FileEditor.svelte b/src/routes/workspace/editor/FileEditor.svelte index e45dac3f..33509114 100644 --- a/src/routes/workspace/editor/FileEditor.svelte +++ b/src/routes/workspace/editor/FileEditor.svelte @@ -5,18 +5,13 @@ var scale = 1; - function onScroll(e: Event) { + function onScroll(e: WheelEvent) { if (!e.ctrlKey) return; e.preventDefault(); - scale *= 1 + Math.sign(e.wheelDeltaY) * 0.1; + scale *= 1 + Math.sign(-e.deltaY) * 0.1; const maxScale = (window.innerWidth - 250) / 950; scale = Math.min(scale, maxScale); } - // addEventListener('resize', (event) => { - // console.log(window.innerWidth); - - // scale = (window.innerWidth - 250) / 800; - // });