aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2008-12-01 13:48:14 +0000
committerArtur Signell <artur.signell@itmill.com>2008-12-01 13:48:14 +0000
commit5b3c3c68debdf09f01ce04150cb094bc1c4d9108 (patch)
tree8423100551497f503dd567cba49bad8a2d773fa3
parentac8cee667481e6231aa3f7996473920f2482ddb9 (diff)
downloadvaadin-framework-5b3c3c68debdf09f01ce04150cb094bc1c4d9108.tar.gz
vaadin-framework-5b3c3c68debdf09f01ce04150cb094bc1c4d9108.zip
Fix for #2250 - Avoid negative sizes in IOrderedLayout
svn changeset:6051/svn branch:trunk
-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());
}