diff options
author | Jouni Koivuviita <jouni@vaadin.com> | 2015-02-06 01:01:07 +0200 |
---|---|---|
committer | Jouni Koivuviita <jouni@vaadin.com> | 2015-02-06 01:01:07 +0200 |
commit | bc9db74216f654901154a08ad877d74bf63c64b5 (patch) | |
tree | 886639b5cc62b36dfff32b6661f08ff8b1f15f16 | |
parent | a76b1212b15e6c84360f5d24892a1120a06d7ebe (diff) | |
download | vaadin-framework-bc9db74216f654901154a08ad877d74bf63c64b5.tar.gz vaadin-framework-bc9db74216f654901154a08ad877d74bf63c64b5.zip |
Fix WidgetUtil BoundingClientRectDouble methods (#16599)
Change-Id: I93ecc9f6b8d8e148256b2f60bd5088d36a6d2b04
-rw-r--r-- | client/src/com/vaadin/client/WidgetUtil.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/WidgetUtil.java b/client/src/com/vaadin/client/WidgetUtil.java index eb6697dda0..4c991b2c3d 100644 --- a/client/src/com/vaadin/client/WidgetUtil.java +++ b/client/src/com/vaadin/client/WidgetUtil.java @@ -564,7 +564,8 @@ public class WidgetUtil { */ public static int getRequiredWidthBoundingClientRect( com.google.gwt.dom.client.Element element) { - return (int) getRequiredWidthBoundingClientRectDouble(element); + return (int) Math + .ceil(getRequiredWidthBoundingClientRectDouble(element)); } /** @@ -584,7 +585,7 @@ public class WidgetUtil { /*-{ if (element.getBoundingClientRect) { var rect = element.getBoundingClientRect(); - return Math.ceil(rect.right - rect.left); + return rect.right - rect.left; } else { return element.offsetWidth; } @@ -642,7 +643,8 @@ public class WidgetUtil { */ public static int getRequiredHeightBoundingClientRect( com.google.gwt.dom.client.Element element) { - return (int) getRequiredHeightBoundingClientRectDouble(element); + return (int) Math + .ceil(getRequiredHeightBoundingClientRectDouble(element)); } /** @@ -663,7 +665,7 @@ public class WidgetUtil { var height; if (element.getBoundingClientRect != null) { var rect = element.getBoundingClientRect(); - height = Math.ceil(rect.bottom - rect.top); + height = rect.bottom - rect.top; } else { height = element.offsetHeight; } |