SketchView控件拓展性问题
Opened this issue · 1 comments
Deleted user commented
类成员修饰符好多都是private和默认,
比如:float simpleScale = 0.5f;//图片载入的缩放倍数
这个变量没有set和get,那么如果无法修改应该用final来表示,这个变量又对应 BitmapUtils.decodeSampleBitMapFromFile(mContext, path, simpleScale);
导致将图片从sd卡去除来的时候,进行了缩放操作,导致细线变粗变模糊,画质不清。
本来想复写
public void setBackgroundByPath(String path) {
Bitmap sampleBM = getSampleBitMap(path);
if (sampleBM != null) {
curSketchData.backgroundBM = sampleBM;
backgroundSrcRect = new Rect(0, 0, curSketchData.backgroundBM.getWidth(), curSketchData.backgroundBM.getHeight());
backgroundDstRect = new Rect(0, 0, mWidth, mHeight);
invalidate();
} else {
Toast.makeText(mContext, "图片文件路径有误!", Toast.LENGTH_SHORT).show();
}
}
结果发现,curSketchData有set没get。。。修饰符又是默认,只能改源码。。。
TangentLu666 commented
OK,为了方便扩展,我把所有属性都改为public,已经改好提交了