From: Leif Åstrand Date: Fri, 4 Jan 2013 14:42:04 +0000 (+0200) Subject: Don't let the caption cause negative width (#10630) X-Git-Tag: 7.0.0.rc1~84 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F577%2F1;p=vaadin-framework.git Don't let the caption cause negative width (#10630) Change-Id: I0d4964111fe72ee23b0d285c4c2340139c426c95 --- 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);