mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
grid to fill all map
This commit is contained in:
parent
0bf8b568a9
commit
cb32ec93f4
1 changed files with 4 additions and 1 deletions
|
|
@ -990,8 +990,11 @@ function drawGrid() {
|
|||
const dy = gridOverlay.attr("dy") || 0;
|
||||
const tr = `scale(${scale}) translate(${dx} ${dy})`;
|
||||
|
||||
const maxWidth = Math.max(+mapWidthInput.value, graphWidth);
|
||||
const maxHeight = Math.max(+mapHeightInput.value, graphHeight);
|
||||
|
||||
d3.select(pattern).attr("stroke", stroke).attr("stroke-width", width).attr("stroke-dasharray", dasharray).attr("stroke-linecap", linecap).attr("patternTransform", tr);
|
||||
gridOverlay.append("rect").attr("width", "100%").attr("height", "100%").attr("fill", "url(" + pattern + ")").attr("stroke", "none");
|
||||
gridOverlay.append("rect").attr("width", maxWidth).attr("height", maxHeight).attr("fill", "url(" + pattern + ")").attr("stroke", "none");
|
||||
}
|
||||
|
||||
function toggleCoordinates(event) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue