Optimized layout calculation for window resizes.
Fixed bug, optimization for cell layout method.