See the answer to But what if I just want to align the colour of two nodes and the nodes are of different shapes?