From da8b43ed411cdafe2ddefcb6078f49ab59c5958e 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: Id44f319b517fdfa419b70d30a9f8d4bd5e82fa63 --- 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 761edf1f11..9b9616f474 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