aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java
index ed3b1711ee..a626bcaae1 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java
@@ -549,18 +549,33 @@ public class IOrderedLayout extends CellBasedLayout {
}
if (isDynamicWidth()) {
- setOuterLayoutWidth(activeLayoutWidth);
- activeLayoutSize.setWidth(activeLayoutWidth);
+ setActiveLayoutWidth(activeLayoutWidth);
+ setOuterLayoutWidth(activeLayoutSize.getWidth());
}
if (isDynamicHeight()) {
- activeLayoutSize.setHeight(activeLayoutHeight);
- setOuterLayoutHeight(activeLayoutHeight);
+ setActiveLayoutHeight(activeLayoutHeight);
+ setOuterLayoutHeight(activeLayoutSize.getHeight());
}
return activeLayoutSize;
}
+ private void setActiveLayoutWidth(int activeLayoutWidth) {
+ if (activeLayoutWidth < 0) {
+ activeLayoutWidth = 0;
+ }
+ activeLayoutSize.setWidth(activeLayoutWidth);
+ }
+
+ private void setActiveLayoutHeight(int activeLayoutHeight) {
+ if (activeLayoutHeight < 0) {
+ activeLayoutHeight = 0;
+ }
+ activeLayoutSize.setHeight(activeLayoutHeight);
+
+ }
+
private void setOuterLayoutWidth(int activeLayoutWidth) {
super.setWidth((activeLayoutWidth + activeMargins.getHorizontal())
+ "px");
@@ -727,7 +742,7 @@ public class IOrderedLayout extends CellBasedLayout {
super.setHeight(height);
if (height != null && !height.equals("")) {
- activeLayoutSize.setHeight(getOffsetHeight()
+ setActiveLayoutHeight(getOffsetHeight()
- activeMargins.getVertical());
}
@@ -749,7 +764,7 @@ public class IOrderedLayout extends CellBasedLayout {
super.setWidth(width);
if (width != null && !width.equals("")) {
- activeLayoutSize.setWidth(getOffsetWidth()
+ setActiveLayoutWidth(getOffsetWidth()
- activeMargins.getHorizontal());
}