61,64c61,65 < /* < * Calculate the layout for the figure and all its subelements. The < * layout is not actually performed but just its dimensions are calculated. < * Insets are added for all non-top-level figures. --- > /** > * Calculate the layout for the figure and all its > * subelements. The layout is not actually performed but just > * its dimensions are calculated. The insets for this figure > * are included in the return value. 71c72 < int maxHeight = 0; --- > int maxHeight = getInsets().top; 82,84d82 < // add insets to calculated rectangle < r.grow(layoutStrategy.getInsets().left + layoutStrategy.getInsets().right, < layoutStrategy.getInsets().top + layoutStrategy.getInsets().bottom); 89c87,89 < maxWidth = Math.max(maxWidth, r.width); --- > maxWidth = Math.max(maxWidth, > r.width + getInsets().left + > getInsets().right); 91a92 > maxHeight += getInsets().bottom; 116,121c117,120 < < // Fix for bug request ID 548000 < // Previously was < // Point partCorner = new Point(r.x + getInsets().left + r.width, r.y + currentFigure.displayBox().height); < // The right inset wasn't included in the calculation < Point partCorner = new Point(r.x + getInsets().left - getInsets().right + r.width, r.y + currentFigure.displayBox().height); --- > Point partCorner = new Point > (r.x + r.width - getInsets().right, > r.y + maxHeight + > currentFigure.displayBox().height); 127,131d125 < // the maximum width has been already calculated < // Fix for bug request ID 548000 < // Previously was < // Point partCorner = new Point(r.x + getInsets().left + r.width, r.y + currentFigure.displayBox().height); < // The right inset wasn't included in the calculation