]> source.dussan.org Git - vaadin-framework.git/commitdiff
Don't let the caption cause negative width (#10630) 77/577/1
authorLeif Åstrand <leif@vaadin.com>
Fri, 4 Jan 2013 14:42:04 +0000 (16:42 +0200)
committerLeif Åstrand <leif@vaadin.com>
Fri, 4 Jan 2013 14:42:04 +0000 (16:42 +0200)
Change-Id: I0d4964111fe72ee23b0d285c4c2340139c426c95

client/src/com/vaadin/client/ui/layout/VLayoutSlot.java

index 509499a5f98f75d63311a09841b5d72371efb654..125f135aeeb24470eff07fbef8efd2b5e410ebe9 100644 (file)
@@ -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);