From bd53f3391e2ad56cd587c74c03804c2ce801bd26 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 6 Feb 2015 01:35:31 +0200 Subject: Correctly round tr width in Escalator (#18820) * screenshot based tests for all themes for various features in Grid Change-Id: Ic6bbb402194132aaf87833215891f5f4ff931099 --- client/src/com/vaadin/client/widgets/Escalator.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/widgets/Escalator.java b/client/src/com/vaadin/client/widgets/Escalator.java index 64f18293e4..8a893337c5 100644 --- a/client/src/com/vaadin/client/widgets/Escalator.java +++ b/client/src/com/vaadin/client/widgets/Escalator.java @@ -1756,7 +1756,13 @@ public class Escalator extends Widget implements RequiresResize, Element row = root.getFirstChildElement(); while (row != null) { - row.getStyle().setWidth(rowWidth, Unit.PX); + // IF there is a rounding error when summing the columns, we + // need to round the tr width up to ensure that columns fit and + // do not wrap + // E.g.122.95+123.25+103.75+209.25+83.52+88.57+263.45+131.21+126.85+113.13=1365.9299999999998 + // For this we must set 1365.93 or the last column will wrap + row.getStyle().setWidth(WidgetUtil.roundSizeUp(rowWidth), + Unit.PX); row = row.getNextSiblingElement(); } } -- cgit v1.2.3