Make zoom hotkeys zoom towards cursor
This commit is contained in:
parent
c99bb2122d
commit
d9c6a3b0e0
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user