diff --git a/src/app/editor/code-view/view.component.ts b/src/app/editor/code-view/view.component.ts index 81a3677..a4f2729 100644 --- a/src/app/editor/code-view/view.component.ts +++ b/src/app/editor/code-view/view.component.ts @@ -182,6 +182,19 @@ export class CodeViewComponent extends CodeViewBase { } }); + this.editor.on("mousewheel", (event) => { + if (event.domEvent.ctrlKey && event.domEvent.deltaY < 0) { + event.preventDefault(); + event.stopPropagation(); + this.zoomIn(); + } + else if (event.domEvent.ctrlKey && event.domEvent.deltaY > 0) { + event.preventDefault(); + event.stopPropagation(); + this.zoomOut(); + } + }); + this.editor.on("change", () => { if (this.debounceId) { clearTimeout(this.debounceId); } this.setDebounceTimeout();