Fixed popup zoom

This commit is contained in:
Tamius Han 2018-09-19 22:52:53 +02:00
parent c7cf9b4be7
commit c713977bb6
2 changed files with 5 additions and 4 deletions

View File

@ -258,7 +258,7 @@ class CommsServer {
} }
this.settings.save(); this.settings.save();
} else if (message.cmd === 'set-zoom') { } else if (message.cmd === 'set-zoom') {
this.setToActive(message); this.sendToActive(message);
} }
} }

View File

@ -59,13 +59,14 @@ class Zoom {
} }
setZoom(scale){ setZoom(scale){
if(scale < this.minScale) { // NOTE: SCALE IS NOT LOGARITHMIC
if(scale < Math.pow(this.minScale)) {
scale = this.minScale; scale = this.minScale;
} else if (scale > this.maxScale) { } else if (scale > Math.pow(this.maxScale)) {
scale = this.maxScale; scale = this.maxScale;
} }
this.scale = Math.pow(2, this.logScale); this.scale = scale;
this.conf.restoreAr(); this.conf.restoreAr();
} }