// extra space equally if no expand ratios are specified inside a
// layout with specified size
if (expandRatios.getKeySet().size() == 0
- && ((!getWidget().vertical && !isUndefinedHeight()) || !isUndefinedWidth())) {
+ && ((getWidget().vertical && !isUndefinedHeight()) || !isUndefinedWidth())) {
expandRatio = 1;
hasExpandRatio.add(child);
} else if (expandRatios.containsKey(pid)
if (layoutManager != null) {
// TODO check caption position
if (vertical) {
- totalSize += layoutManager.getOuterHeight(slot
+ int size = layoutManager.getOuterHeight(slot
.getWidget().getElement())
- layoutManager.getMarginHeight(slot
.getWidget().getElement());
if (slot.hasCaption()) {
- totalSize += layoutManager.getOuterHeight(slot
+ size += layoutManager.getOuterHeight(slot
.getCaptionElement())
- layoutManager.getMarginHeight(slot
.getCaptionElement());
}
+ if (size > 0) {
+ totalSize += size;
+ }
} else {
int max = -1;
max = layoutManager.getOuterWidth(slot.getWidget()
.getCaptionElement());
max = Math.max(max, max2);
}
- totalSize += max;
+ if (max > 0) {
+ totalSize += max;
+ }
}
} else {
totalSize += vertical ? slot.getOffsetHeight() : slot
}
}
// TODO fails in Opera, always returns 0
- totalSize += slot.getSpacingSize(vertical);
+ int spacingSize = slot.getSpacingSize(vertical);
+ if (spacingSize > 0) {
+ totalSize += spacingSize;
+ }
}
// When we set the margin to the first child, we don't need