Merge "Return a copy of the read-only identity Matrix"

This commit is contained in:
Romain Guy
2013-01-31 00:27:55 +00:00
committed by Android (Google) Code Review

View File

@ -562,13 +562,14 @@ public class ImageView extends View {
/** Return the view's optional matrix. This is applied to the
view's drawable when it is drawn. If there is not matrix,
this method will return null.
Do not change this matrix in place. If you want a different matrix
applied to the drawable, be sure to call setImageMatrix().
this method will return an identity matrix.
Do not change this matrix in place but make a copy.
If you want a different matrix applied to the drawable,
be sure to call setImageMatrix().
*/
public Matrix getImageMatrix() {
if (mDrawMatrix == null) {
return Matrix.IDENTITY_MATRIX;
return new Matrix(Matrix.IDENTITY_MATRIX);
}
return mDrawMatrix;
}