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

adjust source position of link to draw

This commit is contained in:
sakazuki 2019-11-02 13:52:58 +09:00
parent d3afa8fd47
commit 69d5ffe1ed

View File

@ -870,7 +870,7 @@ RED.view = (function() {
}
var sc = (quickAddLink.portType === PORT_TYPE_OUTPUT)?1:-1;
if (vertical) {
quickAddLink.el.attr("d",generateLinkPathV(quickAddLink.node.x+portX+sc*quickAddLink.node.w/2,quickAddLink.node.y,point[0]-sc*node_width/2,point[1],sc));
quickAddLink.el.attr("d",generateLinkPathV(quickAddLink.node.x+portX,quickAddLink.node.y+sc*quickAddLink.node.h/2,point[0]-sc*node_width/2,point[1],sc));
}else{
quickAddLink.el.attr("d",generateLinkPath(quickAddLink.node.x+sc*quickAddLink.node.w/2,quickAddLink.node.y+portY,point[0]-sc*node_width/2,point[1],sc));
}
@ -1235,7 +1235,7 @@ RED.view = (function() {
var sc = (drag_line.portType === PORT_TYPE_OUTPUT)?1:-1;
if (vertical) {
drag_line.el.attr("d",generateLinkPathV(drag_line.node.x+portX,drag_line.node.y,mousePos[0],mousePos[1],sc));
drag_line.el.attr("d",generateLinkPathV(drag_line.node.x+portX,drag_line.node.y+sc*drag_line.node.h/2,mousePos[0],mousePos[1],sc));
}else{
drag_line.el.attr("d",generateLinkPath(drag_line.node.x+sc*drag_line.node.w/2,drag_line.node.y+portY,mousePos[0],mousePos[1],sc));
}