Optimized calculating of squareSize