Handle rotation when needed.