Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
arctixdev committed Feb 19, 2024
2 parents db7811f + ff740fc commit 57db6c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions src/routes/workspace/editor/FileEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
// });
</script>

<div class="editor_wrapper" style:display={$editor ? null : 'none'} on:wheel={onScroll}>
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 57db6c1

Please # to comment.