From ddd0d1bef32c0e53a938197dfa6e9f6f15dbdf1e Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Wed, 2 Oct 2019 17:39:38 +0900 Subject: [PATCH] Fix invisible icons in IE --- .../@node-red/editor-client/src/js/ui/view.js | 20 ++++++++++--------- .../@node-red/nodes/icons/alert.svg | 2 +- .../@node-red/nodes/icons/arrow-in.svg | 2 +- .../@node-red/nodes/icons/batch.svg | 2 +- .../@node-red/nodes/icons/bridge-dash.svg | 2 +- .../@node-red/nodes/icons/bridge.svg | 2 +- .../@node-red/nodes/icons/cog.svg | 2 +- .../@node-red/nodes/icons/comment.svg | 2 +- .../node_modules/@node-red/nodes/icons/db.svg | 2 +- .../@node-red/nodes/icons/debug.svg | 2 +- .../@node-red/nodes/icons/envelope.svg | 2 +- .../@node-red/nodes/icons/feed.svg | 2 +- .../@node-red/nodes/icons/file-in.svg | 2 +- .../@node-red/nodes/icons/file-out.svg | 2 +- .../@node-red/nodes/icons/file.svg | 2 +- .../@node-red/nodes/icons/function.svg | 2 +- .../@node-red/nodes/icons/hash.svg | 2 +- .../@node-red/nodes/icons/inject.svg | 2 +- .../@node-red/nodes/icons/join.svg | 2 +- .../@node-red/nodes/icons/light.svg | 2 +- .../@node-red/nodes/icons/link-out.svg | 2 +- .../@node-red/nodes/icons/parser-csv.svg | 2 +- .../@node-red/nodes/icons/parser-html.svg | 2 +- .../@node-red/nodes/icons/parser-json.svg | 2 +- .../@node-red/nodes/icons/parser-xml.svg | 2 +- .../@node-red/nodes/icons/parser-yaml.svg | 2 +- .../@node-red/nodes/icons/range.svg | 2 +- .../@node-red/nodes/icons/rpi.svg | 2 +- .../@node-red/nodes/icons/serial.svg | 2 +- .../@node-red/nodes/icons/sort.svg | 2 +- .../@node-red/nodes/icons/split.svg | 2 +- .../@node-red/nodes/icons/status.svg | 2 +- .../@node-red/nodes/icons/subflow.svg | 2 +- .../@node-red/nodes/icons/swap.svg | 2 +- .../@node-red/nodes/icons/switch.svg | 2 +- .../@node-red/nodes/icons/template.svg | 2 +- .../@node-red/nodes/icons/timer.svg | 2 +- .../@node-red/nodes/icons/trigger.svg | 2 +- .../@node-red/nodes/icons/watch.svg | 2 +- .../@node-red/nodes/icons/white-globe.svg | 2 +- 40 files changed, 50 insertions(+), 48 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 339b6e017..0967c630e 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -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) { diff --git a/packages/node_modules/@node-red/nodes/icons/alert.svg b/packages/node_modules/@node-red/nodes/icons/alert.svg index 06f6c15f3..4337fb496 100644 --- a/packages/node_modules/@node-red/nodes/icons/alert.svg +++ b/packages/node_modules/@node-red/nodes/icons/alert.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/arrow-in.svg b/packages/node_modules/@node-red/nodes/icons/arrow-in.svg index a5fcb49af..de75fbe4e 100644 --- a/packages/node_modules/@node-red/nodes/icons/arrow-in.svg +++ b/packages/node_modules/@node-red/nodes/icons/arrow-in.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/batch.svg b/packages/node_modules/@node-red/nodes/icons/batch.svg index eb513de93..5b3328097 100644 --- a/packages/node_modules/@node-red/nodes/icons/batch.svg +++ b/packages/node_modules/@node-red/nodes/icons/batch.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/bridge-dash.svg b/packages/node_modules/@node-red/nodes/icons/bridge-dash.svg index 45f556a11..7c09d9776 100644 --- a/packages/node_modules/@node-red/nodes/icons/bridge-dash.svg +++ b/packages/node_modules/@node-red/nodes/icons/bridge-dash.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/bridge.svg b/packages/node_modules/@node-red/nodes/icons/bridge.svg index 093071ca8..1112a4625 100644 --- a/packages/node_modules/@node-red/nodes/icons/bridge.svg +++ b/packages/node_modules/@node-red/nodes/icons/bridge.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/node_modules/@node-red/nodes/icons/cog.svg b/packages/node_modules/@node-red/nodes/icons/cog.svg index ae236ff43..8cd81c57b 100644 --- a/packages/node_modules/@node-red/nodes/icons/cog.svg +++ b/packages/node_modules/@node-red/nodes/icons/cog.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/comment.svg b/packages/node_modules/@node-red/nodes/icons/comment.svg index 832dbf895..73ccaec5c 100644 --- a/packages/node_modules/@node-red/nodes/icons/comment.svg +++ b/packages/node_modules/@node-red/nodes/icons/comment.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/db.svg b/packages/node_modules/@node-red/nodes/icons/db.svg index 5b455b606..ae602290d 100644 --- a/packages/node_modules/@node-red/nodes/icons/db.svg +++ b/packages/node_modules/@node-red/nodes/icons/db.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/debug.svg b/packages/node_modules/@node-red/nodes/icons/debug.svg index f102ddb7d..927680ee3 100644 --- a/packages/node_modules/@node-red/nodes/icons/debug.svg +++ b/packages/node_modules/@node-red/nodes/icons/debug.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/envelope.svg b/packages/node_modules/@node-red/nodes/icons/envelope.svg index dacfd673b..13764301c 100644 --- a/packages/node_modules/@node-red/nodes/icons/envelope.svg +++ b/packages/node_modules/@node-red/nodes/icons/envelope.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/feed.svg b/packages/node_modules/@node-red/nodes/icons/feed.svg index dc22a626a..8df69736c 100644 --- a/packages/node_modules/@node-red/nodes/icons/feed.svg +++ b/packages/node_modules/@node-red/nodes/icons/feed.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/node_modules/@node-red/nodes/icons/file-in.svg b/packages/node_modules/@node-red/nodes/icons/file-in.svg index 15950f96f..4004d8cf9 100644 --- a/packages/node_modules/@node-red/nodes/icons/file-in.svg +++ b/packages/node_modules/@node-red/nodes/icons/file-in.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/node_modules/@node-red/nodes/icons/file-out.svg b/packages/node_modules/@node-red/nodes/icons/file-out.svg index 214e307ee..ed2420a64 100644 --- a/packages/node_modules/@node-red/nodes/icons/file-out.svg +++ b/packages/node_modules/@node-red/nodes/icons/file-out.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/node_modules/@node-red/nodes/icons/file.svg b/packages/node_modules/@node-red/nodes/icons/file.svg index 2934c0c15..8edc658c2 100644 --- a/packages/node_modules/@node-red/nodes/icons/file.svg +++ b/packages/node_modules/@node-red/nodes/icons/file.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/function.svg b/packages/node_modules/@node-red/nodes/icons/function.svg index b831a21fa..04bebc370 100644 --- a/packages/node_modules/@node-red/nodes/icons/function.svg +++ b/packages/node_modules/@node-red/nodes/icons/function.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/hash.svg b/packages/node_modules/@node-red/nodes/icons/hash.svg index 4c8e4370e..a8ac048af 100644 --- a/packages/node_modules/@node-red/nodes/icons/hash.svg +++ b/packages/node_modules/@node-red/nodes/icons/hash.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/inject.svg b/packages/node_modules/@node-red/nodes/icons/inject.svg index 8038a313f..841c6c2ca 100644 --- a/packages/node_modules/@node-red/nodes/icons/inject.svg +++ b/packages/node_modules/@node-red/nodes/icons/inject.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/join.svg b/packages/node_modules/@node-red/nodes/icons/join.svg index 491a22b08..0f7fd92af 100644 --- a/packages/node_modules/@node-red/nodes/icons/join.svg +++ b/packages/node_modules/@node-red/nodes/icons/join.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/light.svg b/packages/node_modules/@node-red/nodes/icons/light.svg index ba1c973d4..09d1ac91c 100644 --- a/packages/node_modules/@node-red/nodes/icons/light.svg +++ b/packages/node_modules/@node-red/nodes/icons/light.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/link-out.svg b/packages/node_modules/@node-red/nodes/icons/link-out.svg index efbcd85cc..250348861 100644 --- a/packages/node_modules/@node-red/nodes/icons/link-out.svg +++ b/packages/node_modules/@node-red/nodes/icons/link-out.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/parser-csv.svg b/packages/node_modules/@node-red/nodes/icons/parser-csv.svg index 62698efc4..fff9b5022 100644 --- a/packages/node_modules/@node-red/nodes/icons/parser-csv.svg +++ b/packages/node_modules/@node-red/nodes/icons/parser-csv.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/parser-html.svg b/packages/node_modules/@node-red/nodes/icons/parser-html.svg index 05c8c8628..66c7436b7 100644 --- a/packages/node_modules/@node-red/nodes/icons/parser-html.svg +++ b/packages/node_modules/@node-red/nodes/icons/parser-html.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/parser-json.svg b/packages/node_modules/@node-red/nodes/icons/parser-json.svg index 6ce3d45f5..e93ab5d33 100644 --- a/packages/node_modules/@node-red/nodes/icons/parser-json.svg +++ b/packages/node_modules/@node-red/nodes/icons/parser-json.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/parser-xml.svg b/packages/node_modules/@node-red/nodes/icons/parser-xml.svg index 05c8c8628..66c7436b7 100644 --- a/packages/node_modules/@node-red/nodes/icons/parser-xml.svg +++ b/packages/node_modules/@node-red/nodes/icons/parser-xml.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/parser-yaml.svg b/packages/node_modules/@node-red/nodes/icons/parser-yaml.svg index d3a2cb9e0..f0a23ce9a 100644 --- a/packages/node_modules/@node-red/nodes/icons/parser-yaml.svg +++ b/packages/node_modules/@node-red/nodes/icons/parser-yaml.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/range.svg b/packages/node_modules/@node-red/nodes/icons/range.svg index 6253f01df..51be7a4e7 100644 --- a/packages/node_modules/@node-red/nodes/icons/range.svg +++ b/packages/node_modules/@node-red/nodes/icons/range.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/rpi.svg b/packages/node_modules/@node-red/nodes/icons/rpi.svg index 99185f9b0..33aa12efb 100644 --- a/packages/node_modules/@node-red/nodes/icons/rpi.svg +++ b/packages/node_modules/@node-red/nodes/icons/rpi.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/node_modules/@node-red/nodes/icons/serial.svg b/packages/node_modules/@node-red/nodes/icons/serial.svg index 53c08c448..b07af8123 100644 --- a/packages/node_modules/@node-red/nodes/icons/serial.svg +++ b/packages/node_modules/@node-red/nodes/icons/serial.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/sort.svg b/packages/node_modules/@node-red/nodes/icons/sort.svg index 6af54d712..bfb34d19b 100644 --- a/packages/node_modules/@node-red/nodes/icons/sort.svg +++ b/packages/node_modules/@node-red/nodes/icons/sort.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/split.svg b/packages/node_modules/@node-red/nodes/icons/split.svg index a4609534a..56e078698 100644 --- a/packages/node_modules/@node-red/nodes/icons/split.svg +++ b/packages/node_modules/@node-red/nodes/icons/split.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/status.svg b/packages/node_modules/@node-red/nodes/icons/status.svg index 514e451aa..ec92644a1 100644 --- a/packages/node_modules/@node-red/nodes/icons/status.svg +++ b/packages/node_modules/@node-red/nodes/icons/status.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/subflow.svg b/packages/node_modules/@node-red/nodes/icons/subflow.svg index d211f94ce..2eef4f73d 100644 --- a/packages/node_modules/@node-red/nodes/icons/subflow.svg +++ b/packages/node_modules/@node-red/nodes/icons/subflow.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/swap.svg b/packages/node_modules/@node-red/nodes/icons/swap.svg index 0e67fda9c..e004e8b97 100644 --- a/packages/node_modules/@node-red/nodes/icons/swap.svg +++ b/packages/node_modules/@node-red/nodes/icons/swap.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/node_modules/@node-red/nodes/icons/switch.svg b/packages/node_modules/@node-red/nodes/icons/switch.svg index 378e84b4b..639d46829 100644 --- a/packages/node_modules/@node-red/nodes/icons/switch.svg +++ b/packages/node_modules/@node-red/nodes/icons/switch.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/template.svg b/packages/node_modules/@node-red/nodes/icons/template.svg index ad23bf31e..f8cf412c0 100644 --- a/packages/node_modules/@node-red/nodes/icons/template.svg +++ b/packages/node_modules/@node-red/nodes/icons/template.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/timer.svg b/packages/node_modules/@node-red/nodes/icons/timer.svg index c579cc298..fd7d3f485 100644 --- a/packages/node_modules/@node-red/nodes/icons/timer.svg +++ b/packages/node_modules/@node-red/nodes/icons/timer.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/trigger.svg b/packages/node_modules/@node-red/nodes/icons/trigger.svg index a7c2d87f2..c13298598 100644 --- a/packages/node_modules/@node-red/nodes/icons/trigger.svg +++ b/packages/node_modules/@node-red/nodes/icons/trigger.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/watch.svg b/packages/node_modules/@node-red/nodes/icons/watch.svg index fb9535b2d..e6411fd19 100644 --- a/packages/node_modules/@node-red/nodes/icons/watch.svg +++ b/packages/node_modules/@node-red/nodes/icons/watch.svg @@ -1 +1 @@ - + diff --git a/packages/node_modules/@node-red/nodes/icons/white-globe.svg b/packages/node_modules/@node-red/nodes/icons/white-globe.svg index 474c2f9a6..63679c8ad 100644 --- a/packages/node_modules/@node-red/nodes/icons/white-globe.svg +++ b/packages/node_modules/@node-red/nodes/icons/white-globe.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file