Have shapes be ignored when node returns actualBounds

I have a situation where we create port shapes and add them into our node object so that it shows on the outskirts of the outlying shape. These port shapes only show when user hovers over the node.

The problem is that when I get the actualBounds for the node, i noticed that there seems to be extra space between my shape, and the returned actualBounds, and I realized it is caused by the ports that exists within the node.

Is there a way where I can ignore these ports when returning actualBounds on the Node?

No, if those ports are only transparent or opacity 0.0, they do take up space, so the Node.actualBounds has to include the ports. But if the ports are not visible, then they would not take any room, so the actualBounds would be smaller.

What are you concerned about? Maybe there’s another way.