]> source.dussan.org Git - vaadin-framework.git/commitdiff
Update widths before heights to optimize for measuring widgets (#8313)
authorLeif Åstrand <leif@vaadin.com>
Tue, 14 Feb 2012 14:33:54 +0000 (16:33 +0200)
committerLeif Åstrand <leif@vaadin.com>
Tue, 14 Feb 2012 14:33:54 +0000 (16:33 +0200)
src/com/vaadin/terminal/gwt/client/MeasureManager.java

index c72ee43d604ce9147975afb70b19aa3ddd5f33cd..ffb962864157d380620faa51eba0f599d1e83242 100644 (file)
@@ -61,32 +61,32 @@ public class MeasureManager {
 
             FastStringSet updatedSet = FastStringSet.create();
 
-            JsArrayString needsHeightUpdateArray = needsHeightUpdate.dump();
-            for (int i = 0; i < needsHeightUpdateArray.length(); i++) {
-                String pid = needsHeightUpdateArray.get(i);
+            JsArrayString needsWidthUpdateArray = needsWidthUpdate.dump();
 
-                VPaintableWidget paintable = (VPaintableWidget) paintableMap
-                        .getPaintable(pid);
+            for (int i = 0; i < needsWidthUpdateArray.length(); i++) {
+                String pid = needsWidthUpdateArray.get(i);
+
+                VPaintable paintable = paintableMap.getPaintable(pid);
                 if (paintable instanceof CalculatingLayout) {
                     CalculatingLayout cl = (CalculatingLayout) paintable;
-                    cl.updateVerticalSizes();
-
+                    cl.updateHorizontalSizes();
                 } else if (paintable instanceof ResizeRequired) {
                     ResizeRequired rr = (ResizeRequired) paintable;
                     rr.onResize();
-                    needsWidthUpdate.remove(pid);
+                    needsHeightUpdate.remove(pid);
                 }
                 updatedSet.add(pid);
             }
 
-            JsArrayString needsWidthUpdateArray = needsWidthUpdate.dump();
-            for (int i = 0; i < needsWidthUpdateArray.length(); i++) {
-                String pid = needsWidthUpdateArray.get(i);
+            JsArrayString needsHeightUpdateArray = needsHeightUpdate.dump();
+            for (int i = 0; i < needsHeightUpdateArray.length(); i++) {
+                String pid = needsHeightUpdateArray.get(i);
 
-                VPaintable paintable = paintableMap.getPaintable(pid);
+                VPaintableWidget paintable = (VPaintableWidget) paintableMap
+                        .getPaintable(pid);
                 if (paintable instanceof CalculatingLayout) {
                     CalculatingLayout cl = (CalculatingLayout) paintable;
-                    cl.updateHorizontalSizes();
+                    cl.updateVerticalSizes();
                 } else if (paintable instanceof ResizeRequired) {
                     ResizeRequired rr = (ResizeRequired) paintable;
                     rr.onResize();