if (hasTop) {
            Size boxSize = ctx.box(top);
            width = Math.max(width, boxSize.width);
            topHeight = boxSize.height;
            height += topHeight;