Fix: rework texture data format (#1017)

* fix: rework texture save format

* refactor: move textures to a local folder

* fix: export texture

* fix: don't export empty texture

* chore: pump version

* fix: rescale water mask on screen size change

---------

Co-authored-by: Azgaar <azgaar.fmg@yandex.com>
This commit is contained in:
Azgaar 2023-11-19 14:43:56 +04:00 committed by GitHub
parent 958a2c6ef8
commit ada39b47ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 225 additions and 273 deletions

11
main.js
View file

@ -134,13 +134,6 @@ fogging
.attr("fill", "#e8f0f6")
.attr("filter", "url(#splotch)");
texture
.append("image")
.attr("id", "textureImage")
.attr("preserveAspectRatio", "xMidYMid slice")
.attr("width", "100%")
.attr("height", "100%");
// assign events separately as not a viewbox child
scaleBar.on("mousemove", () => tip("Click to open Units Editor")).on("click", () => editUnits());
legend
@ -1955,7 +1948,9 @@ const regenerateMap = debounce(async function (options) {
// clear the map
function undraw() {
viewbox.selectAll("path, circle, polygon, line, text, use, #zones > g, #armies > g, #ruler > g").remove();
viewbox
.selectAll("path, circle, polygon, line, text, use, #texture > image, #zones > g, #armies > g, #ruler > g")
.remove();
document
.getElementById("deftemp")
.querySelectorAll("path, clipPath, svg")