Here comes another fixlet for some corner cases in SizeRequirements.
Should be perfect soon (I hope).

2005-09-27  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/SizeRequirements.java
        (calculateTiledPositions): Only adjust sizes if the allocated
        span is actually different from the used span.
        (calculateAlignedPositions): Call adjustFromRight also if
        baseline == 0, otherwise we get strange results because 0 * x = 0.

/Roman
Index: javax/swing/SizeRequirements.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/SizeRequirements.java,v
retrieving revision 1.15
diff -u -r1.15 SizeRequirements.java
--- javax/swing/SizeRequirements.java	27 Sep 2005 14:30:08 -0000	1.15
+++ javax/swing/SizeRequirements.java	27 Sep 2005 20:41:15 -0000
@@ -282,7 +282,7 @@
     // Adjust spans so that we exactly fill the allocated region. If
     if (span > allocated)
       adjustSmaller(allocated, children, spans, span);
-    else
+    else if (span < allocated)
       adjustGreater(allocated, children, spans, span);
 
     // Adjust offsets.
@@ -433,7 +433,7 @@
         float align = children[i].alignment;
         // Try to fit the component into the available space.
         int[] spanAndOffset = new int[2];
-        if (align < .5F)
+        if (align < .5F || baseline == 0)
           adjustFromRight(children[i], baseline, allocated, spanAndOffset);
         else
           adjustFromLeft(children[i], baseline, allocated, spanAndOffset);
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to