From 1087930e11cfffd057ac84191398d7ed5b4afc14 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Thu, 6 Dec 2018 01:22:56 +0300 Subject: [PATCH] Update script.js fix use elements sizing --- script.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index fd3849f9..be69dc51 100644 --- a/script.js +++ b/script.js @@ -6643,12 +6643,17 @@ function fantasyMap() { } // to fix use elements sizing - clone.selectAll("use").each(function() { + clone.select("#icons").selectAll("use").each(function() { const size = this.parentNode.getAttribute("size") || 1; this.setAttribute("width", size + "px"); this.setAttribute("height", size + "px"); }); - + clone.select("#terrain").selectAll("use").each(function() { + const size = this.getAttribute("width") || 1; + this.setAttribute("width", size + "px"); + this.setAttribute("height", size + "px"); + }); + // clean attributes //clone.selectAll("*").each(function() { // const attributes = this.attributes;