mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'pr_2304'
This commit is contained in:
@@ -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 |
@@ -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) {
|
||||
|
Reference in New Issue
Block a user