diff options
author | Romain Guy <romainguy@google.com> | 2013-01-30 16:25:50 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2013-01-30 16:25:50 -0800 |
commit | 5370405db2a4413e8fd3e57d2e6664a65bbd514b (patch) | |
tree | e93e2ea62ab397ebdffc7bcb1131640d63e8a7a2 /core/java | |
parent | b20abf4132d2d2e30efcfd831d0c619101a0592e (diff) | |
download | frameworks_base-5370405db2a4413e8fd3e57d2e6664a65bbd514b.zip frameworks_base-5370405db2a4413e8fd3e57d2e6664a65bbd514b.tar.gz frameworks_base-5370405db2a4413e8fd3e57d2e6664a65bbd514b.tar.bz2 |
Return a copy of the read-only identity Matrix
An app trying to modify the returned matrix (despite what the
documentation says...) would crash when the matrix is identity.
Change-Id: I8aae06b712907085088fb9f0321352dd2c3462ac
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/widget/ImageView.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java index 8c710ce..1bbf4eb 100644 --- a/core/java/android/widget/ImageView.java +++ b/core/java/android/widget/ImageView.java @@ -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; } |