diff options
author | Artur Signell <artur@vaadin.com> | 2015-06-02 22:40:00 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2015-06-12 11:51:58 +0000 |
commit | 684e619dd79e233ba798aa116810dd6585df3e7c (patch) | |
tree | 91e3c9646424fdf374fe8e53621f34641046f664 /client | |
parent | 914eafd5fe7d43290abe0b6b07678df0a8f45ee0 (diff) | |
download | vaadin-framework-684e619dd79e233ba798aa116810dd6585df3e7c.tar.gz vaadin-framework-684e619dd79e233ba798aa116810dd6585df3e7c.zip |
Calculate row width correctly when subpixel workaround/fix is active (#17934)
Change-Id: I5fd535bf6622eaf47c5eb5fc509245e558d0a284
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/widgets/Escalator.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/client/src/com/vaadin/client/widgets/Escalator.java b/client/src/com/vaadin/client/widgets/Escalator.java index 7cce34fa22..514fce26dc 100644 --- a/client/src/com/vaadin/client/widgets/Escalator.java +++ b/client/src/com/vaadin/client/widgets/Escalator.java @@ -879,6 +879,7 @@ public class Escalator extends Widget implements RequiresResize, .getCalculatedColumnsWidth(Range.between( columnConfiguration.getFrozenColumnCount(), columnConfiguration.getColumnCount())); + unfrozenPixels -= subpixelBrowserBugDetector.getActiveAdjustment(); double frozenPixels = scrollContentWidth - unfrozenPixels; double hScrollOffsetWidth = tableWrapperWidth - frozenPixels; horizontalScrollbar.setOffsetSize(hScrollOffsetWidth); @@ -4146,7 +4147,8 @@ public class Escalator extends Widget implements RequiresResize, * @return the width of a row, in pixels */ public double calculateRowWidth() { - return getCalculatedColumnsWidth(Range.between(0, getColumnCount())); + return getCalculatedColumnsWidth(Range.between(0, getColumnCount())) + - subpixelBrowserBugDetector.getActiveAdjustment(); } private void assertArgumentsAreValidAndWithinRange(final int index, @@ -4443,7 +4445,7 @@ public class Escalator extends Widget implements RequiresResize, private class SubpixelBrowserBugDetector { private static final double SUBPIXEL_ADJUSTMENT = .1; - private boolean hasAlreadyBeenFixed = false; + private boolean fixActive = false; /** * This is a fix essentially for Firefox and how it handles subpixels. @@ -4460,15 +4462,23 @@ public class Escalator extends Widget implements RequiresResize, * {@value #SUBPIXEL_ADJUSTMENT}px narrower. */ public void checkAndFix() { - if (!hasAlreadyBeenFixed && hasSubpixelBrowserBug()) { + if (!fixActive && hasSubpixelBrowserBug()) { fixSubpixelBrowserBug(); - hasAlreadyBeenFixed = true; + fixActive = true; + } + } + + private double getActiveAdjustment() { + if (fixActive) { + return -SUBPIXEL_ADJUSTMENT; + } else { + return 0.0; } } public void invalidateFix() { adjustBookkeepingPixels(SUBPIXEL_ADJUSTMENT); - hasAlreadyBeenFixed = false; + fixActive = false; } private boolean hasSubpixelBrowserBug() { |