diff options
author | Romain Guy <romainguy@android.com> | 2009-06-29 14:24:56 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2009-06-29 14:26:04 -0700 |
commit | e11232287296eefc82cd895b8392079feedb37cc (patch) | |
tree | 905ed73b8960f7cfe6ce2bad7407e9f1f2264d72 /core | |
parent | bd9aa793b19f7aa529ca4123492f8940b96486b8 (diff) | |
download | frameworks_base-e11232287296eefc82cd895b8392079feedb37cc.zip frameworks_base-e11232287296eefc82cd895b8392079feedb37cc.tar.gz frameworks_base-e11232287296eefc82cd895b8392079feedb37cc.tar.bz2 |
Fixes #1949502. Prevents an NPE in View.buildDrawingCache().
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/View.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index c9a785c..b3180ca 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -5922,8 +5922,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility int height = mBottom - mTop; final AttachInfo attachInfo = mAttachInfo; + final boolean scalingRequired = attachInfo != null && attachInfo.mScalingRequired; - if (autoScale && attachInfo != null && attachInfo.mScalingRequired) { + if (autoScale && scalingRequired) { width = (int) ((width * attachInfo.mApplicationScale) + 0.5f); height = (int) ((height * attachInfo.mApplicationScale) + 0.5f); } @@ -6014,7 +6015,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility computeScroll(); final int restoreCount = canvas.save(); - if (autoScale && attachInfo.mScalingRequired) { + if (autoScale && scalingRequired) { final float scale = attachInfo.mApplicationScale; canvas.scale(scale, scale); } |