aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2015-06-15 15:28:21 +0300
committerHenri Sara <hesara@vaadin.com>2015-07-04 14:34:36 +0300
commitdfd5d4e28abb10434dba4ccd36bb31457558dadf (patch)
treeaedc928f64786c9ba4d319812e7ac2349492c7bc
parent9ba17bdb9ebe2312632dca1a547d6cc563bddd4f (diff)
downloadvaadin-framework-dfd5d4e28abb10434dba4ccd36bb31457558dadf.tar.gz
vaadin-framework-dfd5d4e28abb10434dba4ccd36bb31457558dadf.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: I17aeb2eac9fe4ef72993eb0f9307c1d5a75653a2
-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();
+ }
}
});
}