Fix bug when viewfinder view not full screen

Fix the calculation of the framing rectangle in the preview when the
size of the viewfinder view is not the same as the screen resolution.
Instead of using the resolution of the screen for the calculation, use
the size of the viewfinder view so that views of any size are handled
correctly.