From bc9c49bda5a262f2146ae74964a1c52459f60f3f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Fri, 4 Jan 2013 16:42:04 +0200 Subject: [PATCH] Don't let the caption cause negative width (#10630) Change-Id: I0d4964111fe72ee23b0d285c4c2340139c426c95 --- client/src/com/vaadin/client/ui/layout/VLayoutSlot.java | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.39.5