summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2020-08-17 10:49:50 +0300
committerGitHub <noreply@github.com>2020-08-17 10:49:50 +0300
commite5c42385f337702e561a87806807e3bd3ef9c551 (patch)
tree73e62f11250b3d7bad99e7a26b113ac685afc48c /client
parentaa3757c6649fa056b9495500d6987d213a8bb782 (diff)
downloadvaadin-framework-e5c42385f337702e561a87806807e3bd3ef9c551.tar.gz
vaadin-framework-e5c42385f337702e561a87806807e3bd3ef9c551.zip
Add 1px buffer to Escalator column natural widths. (#12075)
* Add 1px buffer to Escalator column natural widths. The purpose of the buffer is to avoid subpixel handling issues, especially when zoomed in or out. In case fractions need to be adjusted for browser compatibility, round up to ensure the contents have the space they need. Fixes #12048
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/widgets/Escalator.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/client/src/main/java/com/vaadin/client/widgets/Escalator.java b/client/src/main/java/com/vaadin/client/widgets/Escalator.java
index 7774682dad..61dbbf6dd9 100644
--- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java
+++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java
@@ -2254,13 +2254,13 @@ public class Escalator extends Widget
cell.getParentElement().insertBefore(cellClone, cell);
double requiredWidth = getBoundingWidth(cellClone);
- if (BrowserInfo.get().isIE()) {
- /*
- * IE browsers have some issues with subpixels. Occasionally
- * content is overflown even if not necessary. Increase the
- * counted required size by 0.01 just to be on the safe side.
- */
- requiredWidth += 0.01;
+
+ if (requiredWidth > 0) {
+ // add one pixel to avoid subpixel issues
+ // (overflow, unnecessary ellipsis...)
+ requiredWidth += 1;
+ // round up to a fraction that the current browser can handle
+ requiredWidth = WidgetUtil.roundSizeUp(requiredWidth);
}
cellClone.removeFromParent();