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; - // });
From ff740fc3348d662aad1932309d7333ccd312a731 Mon Sep 17 00:00:00 2001 From: Elliott <85990359+Ell1ott@users.noreply.github.com> Date: Mon, 19 Feb 2024 16:55:53 +0100 Subject: [PATCH 2/2] Update tsconfig.json --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 9261ba80..fdb76e9b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "strict": true, "moduleResolution": "bundler", "paths": { - "@tiptap/core": ["node_modules/@tiptap/core/src/index"] + "@tiptap/core": ["./node_modules/@tiptap/core/src/index"] } } // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias