From bbe41febf1e19d3b43ea0320d1e8fcf8f7b192a5 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 15 May 2019 14:17:44 +0100 Subject: [PATCH] Fix view tooltip text position --- .../node_modules/@node-red/editor-client/src/js/ui/view.js | 5 +++-- .../node_modules/@node-red/editor-client/src/sass/flow.scss | 2 +- 2 files changed, 4 insertions(+), 3 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 87367da19..bcbf528c6 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 @@ -2073,7 +2073,7 @@ RED.view = (function() { var labelHeight2 = labelHeight - 4; var path; var lx; - var ly = -labelHeight/2-2; + var ly = -labelHeight/2+1; var anchor; if (direction === "left") { path = "M0 0 l -5 -5 v -"+(labelHeight1)+" q 0 -2 -2 -2 h -"+labelWidth+" q -2 0 -2 2 v "+(labelHeight2)+" q 0 2 2 2 h "+labelWidth+" q 2 0 2 -2 v -"+(labelHeight1)+" l 5 -5"; @@ -2086,12 +2086,13 @@ RED.view = (function() { } else if (direction === "top") { path = "M0 0 l 5 -5 h "+(labelWidth1)+" q 2 0 2 -2 v -"+labelHeight+" q 0 -2 -2 -2 h -"+(labelWidth2)+" q -2 0 -2 2 v "+labelHeight+" q 0 2 2 2 h "+(labelWidth1)+" l 5 5" lx = -labelWidth/2 + 4; - ly = -labelHeight-lineHeight + 6; + ly = -labelHeight-lineHeight+5; anchor = "start"; } tooltip.append("path").attr("d",path); lines.forEach(function(l,i) { ly += labelHeights[i]; + // tooltip.append("path").attr("d","M "+(lx-10)+" "+ly+" l 20 0 m -10 -5 l 0 10 ").attr('r',2).attr("stroke","#f00").attr("stroke-width","1").attr("fill","none") tooltip.append("svg:text").attr("class","red-ui-flow-port-tooltip-label") .attr("x", lx) .attr("y", ly) diff --git a/packages/node_modules/@node-red/editor-client/src/sass/flow.scss b/packages/node_modules/@node-red/editor-client/src/sass/flow.scss index 619680e68..4c152a356 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/flow.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/flow.scss @@ -243,7 +243,7 @@ g.red-ui-flow-link-unknown path.red-ui-flow-link-line { animation: 0.1s ease-in 0s 1 normal forwards red-ui-flow-port-tooltip-fadeIn; pointer-events: none; - path { + path:first-child { fill: $popover-background; stroke: $popover-background; stroke-width: 1;