From c713977bb6288aa0dd881fac3eaf8348f0cc024b Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Wed, 19 Sep 2018 22:52:53 +0200 Subject: [PATCH] Fixed popup zoom --- js/lib/Comms.js | 2 +- js/modules/Zoom.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js/lib/Comms.js b/js/lib/Comms.js index be3d289..017515b 100644 --- a/js/lib/Comms.js +++ b/js/lib/Comms.js @@ -258,7 +258,7 @@ class CommsServer { } this.settings.save(); } else if (message.cmd === 'set-zoom') { - this.setToActive(message); + this.sendToActive(message); } } diff --git a/js/modules/Zoom.js b/js/modules/Zoom.js index 1ef71cb..fb748fe 100644 --- a/js/modules/Zoom.js +++ b/js/modules/Zoom.js @@ -59,13 +59,14 @@ class Zoom { } setZoom(scale){ - if(scale < this.minScale) { + // NOTE: SCALE IS NOT LOGARITHMIC + if(scale < Math.pow(this.minScale)) { scale = this.minScale; - } else if (scale > this.maxScale) { + } else if (scale > Math.pow(this.maxScale)) { scale = this.maxScale; } - this.scale = Math.pow(2, this.logScale); + this.scale = scale; this.conf.restoreAr(); }