fix crash with no camera avail

pull/1/head
Dylan McIntyre 8 years ago
parent 9ef416abdc
commit f2c53ead8c
  1. 2
      camerakit/src/main/java/com/flurgle/camerakit/PreviewImpl.java

@ -67,6 +67,7 @@ public abstract class PreviewImpl {
this.mTrueWidth = width;
this.mTrueHeight = height;
if (width != 0 && height != 0) {
AspectRatio aspectRatio = AspectRatio.of(width, height);
int targetHeight = (int) (getView().getWidth() * aspectRatio.toFloat());
float scaleY;
@ -82,6 +83,7 @@ public abstract class PreviewImpl {
getView().setScaleX(1 / scaleY);
}
}
}
int getTrueWidth() {
return mTrueWidth;

Loading…
Cancel
Save