summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2015-06-15 15:28:21 +0300
committerTeemu Suo-Anttila <teemusa@vaadin.com>2015-06-29 08:45:37 +0000
commit77583865f85abb59a7162c53651b3ef426be5a7c (patch)
tree683a45ad2d8dd13655cf66d9ac289692eb336d19 /client
parentbdfbf348068b9253fd5e63bfb5f825411dec289b (diff)
downloadvaadin-framework-77583865f85abb59a7162c53651b3ef426be5a7c.tar.gz
vaadin-framework-77583865f85abb59a7162c53651b3ef426be5a7c.zip
Don't recalculate columns if only height has changed (#18274)
This patch increases the reported fps in GridResizeTerror from 12 to 35 in my Chrome if only changing the height. No automatic test since performance testing on our shared testing infrastructure would be quite error-prone. Change-Id: I327391dc04dde72a6e770df3b564ae8d4e3c15bb
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/widgets/Grid.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java
index b3edca9140..fef6a01640 100644
--- a/client/src/com/vaadin/client/widgets/Grid.java
+++ b/client/src/com/vaadin/client/widgets/Grid.java
@@ -2585,6 +2585,7 @@ public class Grid<T> extends ResizeComposite implements
/** @see Grid#autoColumnWidthsRecalculator */
private class AutoColumnWidthsRecalculator {
+ private double lastCalculatedInnerWidth = -1;
private final ScheduledCommand calculateCommand = new ScheduledCommand() {
@@ -2619,6 +2620,7 @@ public class Grid<T> extends ResizeComposite implements
} else {
calculate();
}
+ lastCalculatedInnerWidth = escalator.getInnerWidth();
}
};
@@ -7656,7 +7658,9 @@ public class Grid<T> extends ResizeComposite implements
@Override
public void execute() {
- recalculateColumnWidths();
+ if (escalator.getInnerWidth() != autoColumnWidthsRecalculator.lastCalculatedInnerWidth) {
+ recalculateColumnWidths();
+ }
}
});
}