lightbox: Fix + and - zoom shortcuts to be inverses of each other.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-08-23 15:33:51 -07:00 committed by Tim Abbott
parent 207a0d789f
commit 03c24bc459
1 changed files with 4 additions and 4 deletions

View File

@ -25,8 +25,8 @@ export class PanZoomControl {
// Ideally we'd set `bounds` here, but that feature is
// currently broken upstream. See
// https://github.com/anvaka/panzoom/issues/112.
maxZoom: 100,
minZoom: 0.1,
maxZoom: 64,
minZoom: 1 / 16,
filterKey() {
// Disable the library's built in keybindings
return true;
@ -155,13 +155,13 @@ export class PanZoomControl {
zoomIn() {
const w = $(".image-preview").width();
const h = $(".image-preview").height();
this.panzoom.smoothZoom(w / 2, h / 2, 1.5);
this.panzoom.smoothZoom(w / 2, h / 2, Math.SQRT2);
}
zoomOut() {
const w = $(".image-preview").width();
const h = $(".image-preview").height();
this.panzoom.smoothZoom(w / 2, h / 2, 0.5);
this.panzoom.smoothZoom(w / 2, h / 2, Math.SQRT1_2);
}
isActive() {