NFLeo / Matisse

改自知乎原项目, 优化相册选择,优化单选,添加裁剪,选择图片后添加图片压缩

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

华为手机裁剪矩形图时,焦点框不是正方形的

gavin0x00 opened this issue · comments

华为手机裁剪矩形图时,焦点框不是正方形的,是宽比长短的矩形(图片链接),而小米手机是正常的。

commented

ImageCropActivity.java
int cropWidth = mSpec.cropFocusWidth > 0 && mSpec.cropFocusWidth < UIUtils.getScreenWidth(this) - (int) SizeUtils.dp2px(this, 50)
? mSpec.cropFocusWidth : UIUtils.getScreenWidth(this) - (int) SizeUtils.dp2px(this, 50);

    int cropHeight = mSpec.cropFocusHeight > 0 && mSpec.cropFocusHeight < UIUtils.getScreenHeight(this) - (int) SizeUtils.dp2px(this, 400)
            ? mSpec.cropFocusHeight : UIUtils.getScreenHeight(this) - (int) SizeUtils.dp2px(this, 400);

不设置裁剪框大小默认是根据屏幕尺寸来的,所以在不同分辨率设备上表现也不一样。自己设置一下裁剪框尺寸就好了

got it