Swap and invert x and y based on orientation