diff --git a/js/editor/main.js b/js/editor/main.js index fdc5f61..b278fa7 100644 --- a/js/editor/main.js +++ b/js/editor/main.js @@ -208,12 +208,18 @@ export class Editor extends PrimaryView { } } else if (ev.key === '-') { - this.zoom_by(-1); + if (this.mouse_coords) + this.zoom_by(-1, this.mouse_coords[0], this.mouse_coords[1]); + else + this.zoom_by(-1); } // `=` because US keyboards have `+` on the same key as `=`, and `+` is shift-`=` // `+` because many other keyboards have `+` on its own key, un-shifted, while `=` is shifted else if (ev.key === '=' || ev.key === '+') { - this.zoom_by(+1); + if (this.mouse_coords) + this.zoom_by(+1, this.mouse_coords[0], this.mouse_coords[1]); + else + this.zoom_by(+1); } else if (ev.key === '1') { this.set_canvas_zoom(1);