For each port hole (marked with blue arrow) i would like to implement a yellow rectangle “port”
I started with two ports, as shown below, but i’m having problems locating them on the exact spot :
If you are going to be doing resizing, it is probably better to use a spot panel and align the ports relative to the main object. You will probably need a binding on the width/height of the ports that allows them to resize based on the size of the main object as well.
So, even if don’t use resizing tool and only change the pic w/h, i have to adapt the port w/h.
I’m looking for a generic algorithm that gets the pic w/h and sets the port w/h accordingly.
Set the “size” property in the data if you don’t want the default size for your picture. This way your ports can be sized properly from the beginning. I’ve updated the first node in the sample to set a different size for the first node.