|
|
@@ -354,10 +354,10 @@ public class OperationPresenter extends BasePresenter<IOperationView> {
|
|
|
float heightD = 1.0f * rawBitmapHeight / mHeight;
|
|
|
boolean isPortraitPhoto = BigDecimal.valueOf(heightD).compareTo(BigDecimal.valueOf(widthD)) > 0;
|
|
|
if (isPortraitPhoto) {
|
|
|
- // 高的倍距大,以宽为基准
|
|
|
+ // 高的倍距大,以高为基准
|
|
|
if (widthD > 1) {
|
|
|
// 图片宽要缩小到屏幕宽
|
|
|
- float pivot = 1.0f * rawBitmapWidth / mWidth;
|
|
|
+ float pivot = 1.0f * rawBitmapHeight / mHeight;
|
|
|
realLeft = (int) (mLeft * pivot);
|
|
|
realTop = (int) (mTop * pivot);
|
|
|
croppedBitmapWidth = (int) ((mRight - mLeft) * pivot);
|
|
|
@@ -371,10 +371,10 @@ public class OperationPresenter extends BasePresenter<IOperationView> {
|
|
|
croppedBitmapHeight = (int) (1.0f * (mBottom - mTop) / pivot);
|
|
|
}
|
|
|
} else {
|
|
|
- // 宽的倍距大,以高为基准
|
|
|
+ // 宽的倍距大,以宽为基准
|
|
|
if (heightD > 1) {
|
|
|
// 图片高要缩小到屏幕高
|
|
|
- float pivot = 1.0f * rawBitmapHeight / mHeight;
|
|
|
+ float pivot = 1.0f * rawBitmapWidth / mWidth;
|
|
|
realLeft = (int) (mLeft * pivot);
|
|
|
realTop = (int) (mTop * pivot);
|
|
|
croppedBitmapWidth = (int) ((mRight - mLeft) * pivot);
|