Merge branch 'pr_2304'

This commit is contained in:
Nick O'Leary
2019-10-03 15:53:58 +01:00
41 changed files with 51 additions and 49 deletions

View File

@@ -1 +1 @@
<svg width="40" height="60" xmlns="http://www.w3.org/2000/svg"><path d="M18 5v12H7v26h11v12l14-25z" fill="#fff"/></svg>
<svg width="40" height="60" viewBox="0, 0, 40, 60" xmlns="http://www.w3.org/2000/svg"><path d="M18 5v12H7v26h11v12l14-25z" fill="#fff"/></svg>

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 143 B

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) {