]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix WidgetUtil BoundingClientRectDouble methods (#16599)
authorJouni Koivuviita <jouni@vaadin.com>
Thu, 5 Feb 2015 23:01:07 +0000 (01:01 +0200)
committerJouni Koivuviita <jouni@vaadin.com>
Thu, 5 Feb 2015 23:01:07 +0000 (01:01 +0200)
Change-Id: I93ecc9f6b8d8e148256b2f60bd5088d36a6d2b04

client/src/com/vaadin/client/WidgetUtil.java

index eb6697dda000b11ec43c0632cf9bd8f27cf0baea..4c991b2c3d3ec6f9190de4a0fc24ef15e22b1821 100644 (file)
@@ -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;
         }