summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-01-04 16:42:04 +0200
committerLeif Åstrand <leif@vaadin.com>2013-01-04 16:42:04 +0200
commitbc9c49bda5a262f2146ae74964a1c52459f60f3f (patch)
tree656cf616a0a496629899d8179198a4abf2de843f
parentf9bb88a3cd7c424126d96ba24e315569aec8bce9 (diff)
downloadvaadin-framework-bc9c49bda5a262f2146ae74964a1c52459f60f3f.tar.gz
vaadin-framework-bc9c49bda5a262f2146ae74964a1c52459f60f3f.zip
Don't let the caption cause negative width (#10630)
Change-Id: I0d4964111fe72ee23b0d285c4c2340139c426c95
-rw-r--r--client/src/com/vaadin/client/ui/layout/VLayoutSlot.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/layout/VLayoutSlot.java b/client/src/com/vaadin/client/ui/layout/VLayoutSlot.java
index 509499a5f9..125f135aee 100644
--- a/client/src/com/vaadin/client/ui/layout/VLayoutSlot.java
+++ b/client/src/com/vaadin/client/ui/layout/VLayoutSlot.java
@@ -90,6 +90,9 @@ public abstract class VLayoutSlot {
captionAboveCompnent = !caption.shouldBePlacedAfterComponent();
if (!captionAboveCompnent) {
availableWidth -= captionWidth;
+ if (availableWidth < 0) {
+ availableWidth = 0;
+ }
captionStyle.clearLeft();
captionStyle.setRight(0, Unit.PX);
style.setPaddingRight(captionWidth, Unit.PX);