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