From 13e1d94504769a5768c00a31508725b889a65fa0 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Fri, 26 Apr 2019 17:23:59 +0300 Subject: [PATCH] v 0.8.07b --- modules/ui/options.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/ui/options.js b/modules/ui/options.js index fd96ba6e..f3e3cafd 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -742,8 +742,13 @@ function changeDialogsTransparency(value) { } function changeZoomExtent(value) { - zoom.scaleExtent([+zoomExtentMin.value, +zoomExtentMax.value]); - zoom.scaleTo(svg, +value); + const min = +zoomExtentMin.value; + zoom.scaleExtent([min, +zoomExtentMax.value]); + zoom.scaleTo(svg, +value); + const x = min < 1 ? (graphWidth / min - graphWidth) / 2 : graphWidth * .2; + const y = min < 1 ? (graphHeight / min - graphHeight) / 2 : graphHeight * .2; + oceanPattern.select("rect").attr("x", -x).attr("y", -y).attr("width", graphWidth + 2 * x).attr("height", graphHeight + 2 * y); + oceanLayers.select("rect").attr("x", -x).attr("y", -y).attr("width", graphWidth + 2 * x).attr("height", graphHeight + 2 * y); } // control sroted options