add a comment to a wild part

This commit is contained in:
tibbi 2016-06-29 23:31:26 +02:00
parent c74cd14a59
commit 1b2aeffa04
1 changed files with 1 additions and 0 deletions

View File

@ -464,6 +464,7 @@ public class Preview extends ViewGroup implements SurfaceHolder.Callback, View.O
}
final LayoutParams lp = mSurfaceView.getLayoutParams();
// make sure to occupy whole width in every case
if (mScreenSize.x > mPreviewSize.height) {
final float ratio = (float) mScreenSize.x / mPreviewSize.height;
lp.width = (int) (mPreviewSize.height * ratio);