Align nodes on CenterX or CenterY without considering the text block

In BPMN Editor example, alignment of nodes centrally (Center X or Center Y) is possible.

When Task & Gateway aligned using Center X, they are aligned as expected ( since Gatway text is below shape and for Task it is inside the shape)

But when I align them using Center Y, Gateway node is considered completely for alignment
What I need is when the text is outside the shape, then it should be ignored for Central alignment and only shape should be considered.

You could change the implementation of DrawCommandHandler.alignCenterY to work the way that you want. As you can see, the implementation by default assumes it’s working with the whole node. But you could change it to align nodes the way that you want. Remember that Part.move operates on the position of the Nodes in document coordinates.