Fix icon scaling for non .svg icons

This commit is contained in:
Ralph Wetzel 2023-12-20 17:14:12 +01:00
parent 0e8d312794
commit c31e622160

View File

@ -4155,10 +4155,15 @@ RED.view = (function() {
scaleFactor = 30/largestEdge;
}
var width = img.width * scaleFactor;
if (width > 20) {
scalefactor *= 20/width;
width = 20;
}
var height = img.height * scaleFactor;
icon.attr("width",width);
icon.attr("height",height);
icon.attr("x",15-width/2);
icon.attr("y",(30-height)/2);
}
icon.attr("xlink:href",iconUrl);
icon.style("display",null);