Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Port and temporaryToPort not in same position when use margin, how to change it

$
0
0

@lenxeon wrote:

  $(go.Panel, "Horizontal",
new go.Binding("itemArray", "topArray"),
{
    row: 0, column: 1,
    itemTemplate:
        $(go.Panel,
            {
                _side: "top",
                fromSpot: go.Spot.Top,
                toSpot: go.Spot.Top,
                fromLinkable: true,
                toLinkable: true,
                cursor: "crosshair",
                opacity: 0.0,
                // contextMenu: portMenu
            },
            new go.Binding("portId", "portId"),
            new go.Binding("name", "portId"),
            $(go.Shape, "Circle",
                {
                    fill: 'white',
                    stroke: colors.lightblue,
                    strokeWidth: 1,
                    desiredSize: portSize,
                    // margin: new go.Margin(0, 3)
                }
            )
        )  // end itemTemplate
}),  




function commonLinkingToolInit(tool) {
    // FROM
    tool.temporaryFromPort.figure = "Circle";
    tool.temporaryFromPort.fill = '#e9f8ff';
    tool.temporaryFromPort.stroke = "green";
    tool.temporaryFromPort.strokeWidth = 1;
    // tool.temporaryFromPort.desiredSize = portSize;
    ///// TO
    tool.temporaryToPort.figure = "Circle";
    tool.temporaryToPort.fill = '#e9f8ff';
    tool.temporaryFromPort.stroke = "green";
    tool.temporaryToPort.strokeWidth = 1;
    // tool.temporaryToPort.desiredSize = portSize;
}

commonLinkingToolInit(myDiagram.toolManager.linkingTool);
commonLinkingToolInit(myDiagram.toolManager.relinkingTool);

no margin
WX20200112-103254%402x

with margin, temporaryToPort position is wrong

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles