If there is an input/output, give the icon more space.

This commit is contained in:
Bruno Feurer 2022-08-28 15:19:29 +02:00
parent 638986a179
commit dc16376152

View File

@ -4756,7 +4756,7 @@ RED.view = (function() {
if ((!d._def.align && d.inputs !== 0 && d.outputs === 0) || "right" === d._def.align) {
if (this.__iconGroup__) {
this.__iconGroup__.classList.add("red-ui-flow-node-icon-group-right");
this.__iconGroup__.setAttribute("transform", "translate("+(d.w-30)+",0)");
this.__iconGroup__.setAttribute("transform", "translate("+(d.w-(d.outputs ? 33 : 30))+",0)");
}
this.__textGroup__.classList.add("red-ui-flow-node-label-right");
this.__textGroup__.setAttribute("transform", "translate("+(d.w-38)+","+yp+")");
@ -4892,9 +4892,12 @@ RED.view = (function() {
icon.attr("y",function(){return (d.h-d3.select(this).attr("height"))/2;});
const rightAlign = "right" === d._def.align
if (d.inputs && !rightAlign) icon.attr("x",3);
if (d.outputs && rightAlign) icon.attr("x",-3);
const iconShadeHeight = d.h
const iconShadeWidth = 30
const iconShadeWidth = d.inputs && d.outputs ? 33 : 30
this.__iconShade__.setAttribute("d", hideLabel ?
`M5 0 h${iconShadeWidth-10} a 5 5 0 0 1 5 5 v${iconShadeHeight-10} a 5 5 0 0 1 -5 5 h-${iconShadeWidth-10} a 5 5 0 0 1 -5 -5 v-${iconShadeHeight-10} a 5 5 0 0 1 5 -5` : (
"right" === d._def.align ?
@ -4904,7 +4907,7 @@ RED.view = (function() {
)
this.__iconShadeBorder__.style.display = hideLabel?'none':''
this.__iconShadeBorder__.setAttribute("d",
"M " + (((!d._def.align && d.inputs !== 0 && d.outputs === 0) || "right" === d._def.align) ? 0.5 : 29.5) + " "+(d.selected?1:0.5)+" l 0 " + (d.h - (d.selected?2:1))
"M " + (((!d._def.align && d.inputs !== 0 && d.outputs === 0) || "right" === d._def.align) ? 0.5 : iconShadeWidth-0.5) + " "+(d.selected?1:0.5)+" l 0 " + (d.h - (d.selected?2:1))
);
faIcon.attr("y",(d.h+13)/2);
}