]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Account for padding and border when calculating space remaining for content
authorKaren Lease <klease@apache.org>
Sun, 14 Oct 2001 20:44:37 +0000 (20:44 +0000)
committerKaren Lease <klease@apache.org>
Sun, 14 Oct 2001 20:44:37 +0000 (20:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194511 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/layout/BlockArea.java

index 44f6f0c2282162ec433eeccfb6f6c55bcf8e4349..fe73f6e99244c5cd3074461c9c4d5c358dffbd80 100644 (file)
@@ -201,8 +201,18 @@ public class BlockArea extends Area {
                                      - endIndent;
     }
 
+    /**
+     * Return the maximum space remaining for this area's content in
+     * the block-progression-dimension.
+     * Remove top and bottom padding and spacing since these reduce
+     * available space for content and they are not yet accounted for
+     * in the positioning of the object.
+     */
     public int spaceLeft() {
-        return maxHeight - currentHeight;
+        // return maxHeight - currentHeight ;
+        return maxHeight - currentHeight -
+           (getPaddingTop() + getPaddingBottom()
+            + getBorderTopWidth() + getBorderBottomWidth());
     }
 
     public int getHalfLeading() {