From 583fa0c0edc173495bb8566cefcb142eab7b7cdd Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Mon, 7 Aug 2017 10:08:57 +0300 Subject: [PATCH] Fix caption width rounding in Chrome (#9785) Otherwise, TabSheet close button may break the small theme in ReindeerThemeTest when the caption width is rounded down. --- client/src/main/java/com/vaadin/client/VCaption.java | 6 +++--- tests/screenshots | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/main/java/com/vaadin/client/VCaption.java b/client/src/main/java/com/vaadin/client/VCaption.java index 7e8fd97d25..0ed0bc037c 100644 --- a/client/src/main/java/com/vaadin/client/VCaption.java +++ b/client/src/main/java/com/vaadin/client/VCaption.java @@ -541,10 +541,10 @@ public class VCaption extends HTML { } if (captionText != null) { int textWidth = captionText.getScrollWidth(); - if (BrowserInfo.get().isFirefox()) { + if (BrowserInfo.get().isFirefox() || BrowserInfo.get().isChrome()) { /* - * In Firefox3 the caption might require more space than the - * scrollWidth returns as scrollWidth is rounded down. + * The caption might require more space than the scrollWidth + * returns as scrollWidth is rounded down. */ int requiredWidth = WidgetUtil.getRequiredWidth(captionText); if (requiredWidth > textWidth) { diff --git a/tests/screenshots b/tests/screenshots index 7d70f6d3fa..2241145197 160000 --- a/tests/screenshots +++ b/tests/screenshots @@ -1 +1 @@ -Subproject commit 7d70f6d3fa34ae6fdbfb874994f24ba08abfe13b +Subproject commit 22411451972c80c172196361499d8403c9323c1d -- 2.39.5