mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
v1.3.47
This commit is contained in:
parent
5e9bd86069
commit
12a96938d2
1 changed files with 4 additions and 3 deletions
|
|
@ -153,12 +153,13 @@ function changeMapSize() {
|
||||||
|
|
||||||
// just apply canvas size that was already set
|
// just apply canvas size that was already set
|
||||||
function applyMapSize() {
|
function applyMapSize() {
|
||||||
|
const zoomMin = +zoomExtentMin.value, zoomMax = +zoomExtentMax.value;
|
||||||
graphWidth = +mapWidthInput.value;
|
graphWidth = +mapWidthInput.value;
|
||||||
graphHeight = +mapHeightInput.value;
|
graphHeight = +mapHeightInput.value;
|
||||||
svgWidth = Math.min(graphWidth, window.innerWidth)
|
svgWidth = Math.min(graphWidth, window.innerWidth);
|
||||||
svgHeight = Math.min(graphHeight, window.innerHeight)
|
svgHeight = Math.min(graphHeight, window.innerHeight);
|
||||||
svg.attr("width", svgWidth).attr("height", svgHeight);
|
svg.attr("width", svgWidth).attr("height", svgHeight);
|
||||||
zoom.translateExtent([[0, 0],[graphWidth, graphHeight]]).scaleExtent([1, 20]).scaleTo(svg, 1);
|
zoom.translateExtent([[0, 0],[graphWidth, graphHeight]]).scaleExtent([zoomMin, zoomMax]).scaleTo(svg, zoomMin);
|
||||||
//viewbox.attr("transform", null).attr("clip-path", "url(#mapClip)");
|
//viewbox.attr("transform", null).attr("clip-path", "url(#mapClip)");
|
||||||
//defs.append("clipPath").attr("id", "mapClip").append("rect").attr("x", 0).attr("y", 0).attr("width", graphWidth).attr("height", graphHeight);
|
//defs.append("clipPath").attr("id", "mapClip").append("rect").attr("x", 0).attr("y", 0).attr("width", graphWidth).attr("height", graphHeight);
|
||||||
//zoom.translateExtent([[-svgWidth*.2, -graphHeight*.2], [svgWidth*1.2, graphHeight*1.2]]);
|
//zoom.translateExtent([[-svgWidth*.2, -graphHeight*.2], [svgWidth*1.2, graphHeight*1.2]]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue