]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
fixed: leader didn't fill line in content table
authorfotis <fotis@unknown>
Thu, 1 Feb 2001 23:04:20 +0000 (23:04 +0000)
committerfotis <fotis@unknown>
Thu, 1 Feb 2001 23:04:20 +0000 (23:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194009 13f79535-47bb-0310-9956-ffa450edef68

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

index cd3d1a8e41080c528a7c8b87143b3919d69f8015..27e985aa6a30be19164b42bfbe9b13129018a668 100644 (file)
@@ -487,14 +487,18 @@ public class LineArea extends Area {
                           int ruleStyle, int ruleThickness, int leaderPatternWidth,
                           int leaderAlignment) {
         WordArea leaderPatternArea;
-        int leaderLength;
+        int leaderLength = 0;
         int remainingWidth =
           this.getContentWidth() - this.getCurrentXPosition();
-        //checks whether leaderLenghtOptimum fits into rest of line;
-        //should never overflow, asit has been checked already in BlockArea
-        if (remainingWidth < leaderLengthOptimum) {
+        /** checks whether leaderLenghtOptimum fits into rest of line;
+         *  should never overflow, as it has been checked already in BlockArea
+         *  first check: use remaining width if it smaller than optimum oder maximum
+         * */
+        if ((remainingWidth <= leaderLengthOptimum) ||   (remainingWidth <= leaderLengthMaximum)) {
             leaderLength = remainingWidth;
-        } else {
+        } else if ((remainingWidth > leaderLengthOptimum) && ( remainingWidth > leaderLengthMaximum)) {
+            leaderLength = leaderLengthMaximum;
+        } else if ((leaderLengthOptimum > leaderLengthMaximum) && (leaderLengthOptimum < remainingWidth)) {
             leaderLength = leaderLengthOptimum;
         }
         switch (leaderPattern) {