adorsys / YesWeScan

A library with a ready to use view controller for document scanning
Apache License 2.0
102 stars 33 forks source link

Fix an issue with the preview being slightly off #2

Closed xavierLowmiller closed 6 years ago

xavierLowmiller commented 6 years ago

In the current implementation, we assumed that the Image Capture Session has the same aspect ratio as the containing UIView, or would be scaled to make it so.

This is not the case. Instead, the preview behaves like UIView.ContentMode.AspectFill, truncating portions that do not fit.

The result looks like this:

before

This Pull Request accounts for the mismatch in aspect ratios, fixing the problem:

after