Zoom with ctrl

This commit is contained in:
Simon Lydell 2024-04-28 14:22:32 +02:00
parent 430fa5c354
commit 4977ba13ed

View File

@ -309,6 +309,8 @@ export class Editor extends PrimaryView {
// Mouse wheel to zoom // Mouse wheel to zoom
this.set_canvas_zoom(1); this.set_canvas_zoom(1);
this.viewport_el.addEventListener('wheel', ev => { this.viewport_el.addEventListener('wheel', ev => {
if (!ev.ctrlKey)
return;
// The delta is platform and hardware dependent and ultimately kind of useless, so just // The delta is platform and hardware dependent and ultimately kind of useless, so just
// treat each event as a click and hope for the best // treat each event as a click and hope for the best
if (ev.deltaY === 0) if (ev.deltaY === 0)