Rotate square according to device orientation