Fix invisible icons in IE

This commit is contained in:
Kazuhito Yokoi
2019-10-02 17:39:38 +09:00
parent af742ea536
commit ddd0d1bef3
40 changed files with 50 additions and 48 deletions

View File

@@ -2499,16 +2499,18 @@ RED.view = (function() {
var img = new Image();
img.src = iconUrl;
img.onload = function() {
var largestEdge = Math.max(img.width,img.height);
var scaleFactor = 1;
if (largestEdge > 30) {
scaleFactor = 30/largestEdge;
if (!iconUrl.match(/\.svg$/)) {
var largestEdge = Math.max(img.width,img.height);
var scaleFactor = 1;
if (largestEdge > 30) {
scaleFactor = 30/largestEdge;
}
var width = img.width * scaleFactor;
var height = img.height * scaleFactor;
icon.attr("width",width);
icon.attr("height",height);
icon.attr("x",15-width/2);
}
var width = img.width * scaleFactor;
var height = img.height * scaleFactor;
icon.attr("width",width);
icon.attr("height",height);
icon.attr("x",15-width/2);
icon.attr("xlink:href",iconUrl);
icon.style("display",null);
//if ("right" == d._def.align) {