classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] FYI: OverlayLayout fixlet


From: Mark Wielaard
Subject: Re: [cp-patches] FYI: OverlayLayout fixlet
Date: Thu, 20 Oct 2005 01:16:04 +0200

Hi,

On Wed, 2005-10-19 at 17:38 +0200, Roman Kennke wrote:
> This fixes the OverlayLayout so that it respects the container's insets
> correctly.
> 
> 2005-10-19  Roman Kennke  <address@hidden>
> 
>         * javax/swing/OverlayLayout.java
>         (checkLayout): Respect the container's insets correctly.

This was missing the attached patch. But looks fine.

Cheers,

Mark
===================================================================
RCS file: 
/cvsroot/classpath/cvsroot/classpath/classpath/javax/swing/OverlayLayout.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- classpath/classpath/javax/swing/OverlayLayout.java  2005/09/29 22:32:18     
1.8
+++ classpath/classpath/javax/swing/OverlayLayout.java  2005/10/19 15:37:29     
1.9
@@ -41,6 +41,7 @@
 import java.awt.Component;
 import java.awt.Container;
 import java.awt.Dimension;
+import java.awt.Insets;
 import java.awt.LayoutManager2;
 import java.io.Serializable;
 
@@ -397,9 +398,14 @@
         offsetsY = new int[len];
         spansX = new int[len];
         spansY = new int[len];
-        SizeRequirements.calculateAlignedPositions(target.getWidth(), xTotal,
+
+        Insets in = target.getInsets();
+        int width = target.getWidth() - in.left - in.right;
+        int height = target.getHeight() - in.top - in.bottom;
+
+        SizeRequirements.calculateAlignedPositions(width, xTotal,
                                                    xChildren, offsetsX, 
spansX);
-        SizeRequirements.calculateAlignedPositions(target.getHeight(), yTotal,
+        SizeRequirements.calculateAlignedPositions(height, yTotal,
                                                    yChildren, offsetsY, 
spansY);
       }
   }

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]