PhotoView.java getDisplayMatrix()
@Override
public Matrix getDisplayMatrix() {
return mAttacher.getDrawMatrix();
}
Should be mAttacher.getDisplayMatrix() ?
This is implemented correctly, see: https://github.com/chrisbanes/PhotoView/blob/master/library/src/main/java/uk/co/senab/photoview/PhotoViewAttacher.java#L649
It returns copy of DrawMatrix, not the reference to matrix addressed in PhotoViewAttacher implementation
Yes, I think PhotoView#getDisplayMatrix() should returns copy of DrawMatrix, but it returns the reference now.
It is not, https://developer.android.com/reference/android/graphics/Matrix.html#Matrix(android.graphics.Matrix)
PhotoView#getDisplayMatrix() returns mAttcher.getDrawMatrix(), which is
public Matrix getDrawMatrix() {
mDrawMatrix.set(mBaseMatrix);
mDrawMatrix.postConcat(mSuppMatrix);
return mDrawMatrix;
}
It returns reference of mDrawMatrix, not copy.
Oh, you're right, typo, corrected within PhotoView, was looking into attacher. Thanks !