Widget w = getRelatedWidget();
if (w != null) {
if (w instanceof SlotWidget) {
p = ((SlotWidget) w).getAnchorPosition();
} else {
Rectangle r = w.convertLocalToScene(w.getBounds());
int y = r.y + r.height / 2;
int x = r.x;
if (alignment == HorizontalAlignment.Center) {
x = r.x + r.width / 2;
} else if (alignment == HorizontalAlignment.Right) {