From: Artur Signell Date: Tue, 2 Dec 2008 09:47:38 +0000 (+0000) Subject: Fix for #2258 - Problems when changing component size relative<->absolute X-Git-Tag: 6.7.0.beta1~3681 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2d874beb3f6031c5be8a8a910df1ed93aa811fb6;p=vaadin-framework.git Fix for #2258 - Problems when changing component size relative<->absolute svn changeset:6062/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java index 8cd638f6d4..a95f3a1eec 100755 --- a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java @@ -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); + } + } /**