diff options
author | John Ahlroos <john@vaadin.com> | 2012-09-13 11:02:13 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-09-13 11:02:13 +0300 |
commit | eef6af3029923b6ad9076e264394bfa8b9b4b789 (patch) | |
tree | a622577e9f2360faa8254d7874b5ee355a9f8fef /shared | |
parent | 0bd47dcbb4813d08ecba6941ac63465f21cfde0b (diff) | |
download | vaadin-framework-eef6af3029923b6ad9076e264394bfa8b9b4b789.tar.gz vaadin-framework-eef6af3029923b6ad9076e264394bfa8b9b4b789.zip |
Ensures negative height is not returned in HorizontalLayout height calculations #9596
Diffstat (limited to 'shared')
-rw-r--r-- | shared/src/com/vaadin/shared/ui/ComponentStateUtil.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java index a7b3d5a281..5e6700b425 100644 --- a/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java +++ b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java @@ -26,6 +26,14 @@ public final class ComponentStateUtil { return state.styles != null && !state.styles.isEmpty(); } + public static final boolean isRelativeWidth(ComponentState state) { + return state.width != null && state.width.endsWith("%"); + } + + public static final boolean isRelativeHeight(ComponentState state) { + return state.height != null && state.height.endsWith("%"); + } + /** * Removes an event listener id. * |