This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: AWT layout bug fixes


I'm checking this in.
This fixes a couple layout bugs.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* java/awt/FlowLayout.java (layoutContainer): Correctly compute
	loop termination condition.
	* java/awt/GridLayout.java (getSize): Use `real_cols' to compute
	width.

Index: java/awt/FlowLayout.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/FlowLayout.java,v
retrieving revision 1.5
diff -u -r1.5 FlowLayout.java
--- java/awt/FlowLayout.java 2002/01/22 22:40:04 1.5
+++ java/awt/FlowLayout.java 2002/01/25 17:19:35
@@ -207,12 +207,12 @@
 	else
 	  x = d.width - new_w;
 
-	for (int k = i; i < j; ++k)
+	for (int k = i; k < j; ++k)
 	  {
-	    if (comps[i].visible)
+	    if (comps[k].visible)
 	      {
-		Dimension c = comps[i].getPreferredSize ();
-		comps[i].setLocation (x, y);
+		Dimension c = comps[k].getPreferredSize ();
+		comps[k].setLocation (x, y);
 		x += c.width + vgap;
 	      }
 	  }
Index: java/awt/GridLayout.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/GridLayout.java,v
retrieving revision 1.4
diff -u -r1.4 GridLayout.java
--- java/awt/GridLayout.java 2002/01/22 22:40:05 1.4
+++ java/awt/GridLayout.java 2002/01/25 17:19:35
@@ -320,8 +320,8 @@
     Insets ins = parent.getInsets ();
     // We subtract out an extra gap here because the gaps are only
     // between cells.
-    w = ins.left + ins.right + real_rows * (w + hgap) - hgap;
-    h = ins.top + ins.bottom + real_cols * (h + vgap) - vgap;
+    w = ins.left + ins.right + real_cols * (w + hgap) - hgap;
+    h = ins.top + ins.bottom + real_rows * (h + vgap) - vgap;
     return new Dimension (w, h);
   }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]