1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix view tooltip text position

This commit is contained in:
Nick O'Leary 2019-05-15 14:17:44 +01:00
parent 031362a633
commit bbe41febf1
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 4 additions and 3 deletions

View File

@ -2073,7 +2073,7 @@ RED.view = (function() {
var labelHeight2 = labelHeight - 4; var labelHeight2 = labelHeight - 4;
var path; var path;
var lx; var lx;
var ly = -labelHeight/2-2; var ly = -labelHeight/2+1;
var anchor; var anchor;
if (direction === "left") { 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"; 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") { } 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" 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; lx = -labelWidth/2 + 4;
ly = -labelHeight-lineHeight + 6; ly = -labelHeight-lineHeight+5;
anchor = "start"; anchor = "start";
} }
tooltip.append("path").attr("d",path); tooltip.append("path").attr("d",path);
lines.forEach(function(l,i) { lines.forEach(function(l,i) {
ly += labelHeights[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") tooltip.append("svg:text").attr("class","red-ui-flow-port-tooltip-label")
.attr("x", lx) .attr("x", lx)
.attr("y", ly) .attr("y", ly)

View File

@ -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; animation: 0.1s ease-in 0s 1 normal forwards red-ui-flow-port-tooltip-fadeIn;
pointer-events: none; pointer-events: none;
path { path:first-child {
fill: $popover-background; fill: $popover-background;
stroke: $popover-background; stroke: $popover-background;
stroke-width: 1; stroke-width: 1;