Thanks Walter. I guess I was not fully aware of there being next to fromPort also fromSpot. Now we already had this:
function makePort(name, align, spot, output, input) {
return $(Shape, {
fill: "transparent", // changed to a color in the mouseEnter event handler
strokeWidth: 0, // no stroke
width: 8, // if not stretching horizontally, just 8 wide
height: 8, // if not stretching vertically, just 8 tall
alignment: align, // align the port on the main Shape
portId: name, // declare this object to be a "port"
fromSpot: spot, // declare where links may connect at this port
fromLinkable: output, // declare whether the user may draw links from here
toSpot: spot, // declare where links may connect at this port
toLinkable: input, // declare whether the user may draw links to here
cursor: "pointer", // show a different cursor to indicate potential link point
mouseEnter: (e, port) => {
// the PORT argument will be this Shape
if (!e.diagram.isReadOnly)
{
port.fill = "rgba(255,0,255,0.5)";
port.width = 8;
port.height = 8;
}
},
mouseLeave: (e, port) => {
port.fill = "transparent";
port.width = 1;
port.height = 1;
}
});
}
which we then called like this:
makePort(“L”, Spot.Left, Spot.Left, true, true),
makePort(“T”, Spot.Top, Spot.TopSide, true, true),
makePort(“B”, Spot.Bottom, Spot.BottomSide, true, true),
makePort(“R”, Spot.Right, Spot.RightSide, true, true),
It seems that if I change the port.width and port.height to 1, I do not have the issue anymore.