Android放大时绘制的路径行为不一致

Android放大时绘制的路径行为不一致,android,Android,我正在开发图像编辑应用程序,并被困在这里 public void onDraw(Canvas canvas) { // TODO Auto-generated method stub super.onDraw(canvas); // int width=this.getDrawable().getIntrinsicWidth(); // int height=this.getDrawable().getIntrinsicHeight(); // float

我正在开发图像编辑应用程序,并被困在这里

public void onDraw(Canvas canvas) {
    // TODO Auto-generated method stub
    super.onDraw(canvas);
    // int width=this.getDrawable().getIntrinsicWidth();
    // int height=this.getDrawable().getIntrinsicHeight();
    // float sw=((float)getBitmapRect().width())/width;
    // float sh=((float)getBitmapRect().height())/height;
    matrix = new Matrix();
    // matrix.postScale(sw, sh);

    canvas.setMatrix(getDisplayMatrix());
    canvas.concat(matrix);
    canvas.save();
    if (MainActivity.checkBtnOn == MainActivity.BSS_ONE) {
        for (Pair<Path, Float> p : foregroundPaths) {
            mPaint.setStrokeWidth(p.second);
            canvas.drawPath(p.first, mPaint);
         }

    } else if (MainActivity.checkBtnOn == MainActivity.BSS_TWO) {
        for (Pair<Path, Float> p : foregroundPaths) {
            mPaint.setStrokeWidth(p.second);
            canvas.drawPath(p.first, mPaint);
        }
    } else {   
        for (Pair<Path, Float> p : foregroundPaths) {
            mPaint.setStrokeWidth(p.second);
            canvas.drawPath(p.first, mPaint);
        }
    }

    // matrix.postScale(getScale(), getScale());
    rect = canvas.getClipBounds();
    displayRectF = new RectF(rect.left, rect.top, rect.right, rect.bottom);
    // rect =drawable.getBounds();


    canvas.restore();

}
public void onDraw(画布){
//TODO自动生成的方法存根
super.onDraw(帆布);
//int width=this.getDrawable().getIntrinsicWidth();
//int height=this.getDrawable().getIntrinsicHeight();
//float sw=((float)getBitmapRect().width())/width;
//float sh=((float)getBitmapRect().height())/height;
矩阵=新矩阵();
//矩阵。后量表(西南、上海);
setMatrix(getDisplayMatrix());
canvas.concat(矩阵);
canvas.save();
if(MainActivity.checkBtnOn==MainActivity.BSS_ONE){
用于(p对:前地面路径){
mPaint.设定行程宽度(p.秒);
画布绘制路径(p.first,mPaint);
}
}else if(MainActivity.checkBtnOn==MainActivity.BSS_二){
用于(p对:前地面路径){
mPaint.设定行程宽度(p.秒);
画布绘制路径(p.first,mPaint);
}
}否则{
用于(p对:前地面路径){
mPaint.设定行程宽度(p.秒);
画布绘制路径(p.first,mPaint);
}
}
//postScale(getScale(),getScale());
rect=canvas.getClipBounds();
displayRectF=新的RectF(rect.left、rect.top、rect.right、rect.bottom);
//rect=drawable.getBounds();
canvas.restore();
}

我的问题是“我做错了什么,导致绘制的路径行为不一致。”指的是缩放时其位置的更改(对于缩放,我使用的是sephiroth库)。我附加了两个图像链接。第一个图像适合屏幕,第二个图像适合缩放

请帮助我,否则任何建议都将不胜感激。 谢谢

问题解决了 我刚搬走

    canvas.setMatrix(getDisplayMatrix()); //removed

    canvas.concat(getDisplayMatrix());  //add