Use ES6 features, rather than a temporary variable, when swapping padding values in BaseViewer._setScale

This commit is contained in:
Jonas Jenwald 2018-08-20 14:18:16 +02:00
parent eef70c1eae
commit 0b32dfea86

View File

@ -594,9 +594,7 @@ class BaseViewer {
let vPadding = noPadding ? 0 : VERTICAL_PADDING;
if (!noPadding && this._isScrollModeHorizontal) {
const temp = hPadding;
hPadding = vPadding;
vPadding = temp;
[hPadding, vPadding] = [vPadding, hPadding]; // Swap the padding values.
}
let pageWidthScale = (this.container.clientWidth - hPadding) /
currentPage.width * currentPage.scale;