]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #2258 - Problems when changing component size relative<->absolute
authorArtur Signell <artur.signell@itmill.com>
Tue, 2 Dec 2008 09:47:38 +0000 (09:47 +0000)
committerArtur Signell <artur.signell@itmill.com>
Tue, 2 Dec 2008 09:47:38 +0000 (09:47 +0000)
svn changeset:6062/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java

index 8cd638f6d41bf3df63e952025a09db481f0d09a1..a95f3a1eec42288ecbd9c258ce061ac8d0c96b57 100755 (executable)
@@ -1064,14 +1064,7 @@ public class ApplicationConnection {
         float relativeWidth = Util.parseRelativeSize(w);
         float relativeHeight = Util.parseRelativeSize(h);
 
-        // first set absolute sizes
-        if (relativeHeight < 0.0) {
-            component.setHeight(h);
-        }
-        if (relativeWidth < 0.0) {
-            component.setWidth(w);
-        }
-
+        // First update maps so they are correct in the setHeight/setWidth calls
         if (relativeHeight >= 0.0 || relativeWidth >= 0.0) {
             // One or both is relative
             FloatSize relativeSize = new FloatSize(relativeWidth,
@@ -1081,15 +1074,27 @@ public class ApplicationConnection {
                 // The component has changed from absolute size to relative size
                 relativeSizeChanges.add(component);
             }
-            handleComponentRelativeSize(component);
         } else if (relativeHeight < 0.0 && relativeWidth < 0.0) {
-
             if (componentRelativeSizes.remove(component) != null) {
                 // The component has changed from relative size to absolute size
                 relativeSizeChanges.add(component);
             }
         }
 
+        // Set absolute sizes
+        if (relativeHeight < 0.0) {
+            component.setHeight(h);
+        }
+        if (relativeWidth < 0.0) {
+            component.setWidth(w);
+        }
+
+       // Set relative sizes
+        if (relativeHeight >= 0.0 || relativeWidth >= 0.0) {
+            // One or both is relative
+            handleComponentRelativeSize(component);
+        }
+
     }
 
     /**