Add support for nested rectangles