Android zxing cambia orientación a retrato

Estoy tratando de girar la pantalla de Zxing después de leer algunas preguntas y publicaciones sobre el problema. Después de seguir las instrucciones, la pantalla giró, pero el rectángulo del escáner no está colocado como debería (como se puede ver en la imagen adjunta).

Esto es lo que he hecho:

en CameraConfigurationManager:

<code>camera.setDisplayOrientation(90);
</code>

en DecodeHandler.java

<code>byte[] rotatedData = new byte[data.length];
    for (int y = 0; y < height; y++) {
        for (int x = 0; x < width; x++)
             rotatedData[x * height + height - y - 1] = data[x + y * width];
     }
int tmp = width;         
width = height;
height = tmp;
</code>

en CameraManager.java:

<code>rect.left = rect.left * cameraResolution.y / screenResolution.x;
rect.right = rect.right * cameraResolution.y / screenResolution.x;
rect.top = rect.top * cameraResolution.x / screenResolution.y;
rect.bottom = rect.bottom * cameraResolution.x / screenResolution.y;
</code>

Respuestas a la pregunta(9)

Su respuesta a la pregunta