v1.6.12 - change ocean pattern to image

This commit is contained in:
Azgaar 2021-03-06 18:55:39 +03:00
parent 69c44317e3
commit bb260a0b89
12 changed files with 46 additions and 70 deletions

View file

@ -1111,10 +1111,10 @@ function toggleTexture(event) {
// append default texture image selected by default. Don't append on load to not harm performance
if (!texture.selectAll("*").size()) {
const x = +styleTextureShiftX.value, y = +styleTextureShiftY.value;
const href = styleTextureInput.value === "default" ? getDefaultTexture() : setBase64Texture(styleTextureInput.value);
texture.append("image").attr("id", "textureImage")
const image = texture.append("image").attr("id", "textureImage")
.attr("x", x).attr("y", y).attr("width", graphWidth - x).attr("height", graphHeight - y)
.attr("xlink:href", href).attr("preserveAspectRatio", "xMidYMid slice");
.attr("xlink:href", getDefaultTexture()).attr("preserveAspectRatio", "xMidYMid slice");
if (styleTextureInput.value !== "default") getBase64(styleTextureInput.value, base64 => image.attr("xlink:href", base64));
}
$('#texture').fadeIn();
zoom.scaleBy(svg, 1.00001); // enforce browser re-draw