summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDiego Perez <diegoperez@google.com>2015-02-27 15:31:36 +0000
committerDiego Perez <diegoperez@google.com>2015-03-04 16:46:21 +0000
commite81096458f689ab3c0c4dbab2452722c3e3623c4 (patch)
treeae2a342433331350cb277fe6c666da04e7d62bcb /tools
parentdd3fc6b907e5059b52715b69cfbf9632d6636011 (diff)
downloadframeworks_base-e81096458f689ab3c0c4dbab2452722c3e3623c4.zip
frameworks_base-e81096458f689ab3c0c4dbab2452722c3e3623c4.tar.gz
frameworks_base-e81096458f689ab3c0c4dbab2452722c3e3623c4.tar.bz2
Fix crash when shadowSize is 0
Change-Id: I9f131afc95a2571fbc8a737df37f43653cfbb90d
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/src/android/view/ShadowPainter.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/src/android/view/ShadowPainter.java b/tools/layoutlib/bridge/src/android/view/ShadowPainter.java
index 38846bd..a0db7bf 100644
--- a/tools/layoutlib/bridge/src/android/view/ShadowPainter.java
+++ b/tools/layoutlib/bridge/src/android/view/ShadowPainter.java
@@ -65,6 +65,9 @@ public class ShadowPainter {
@SuppressWarnings({"SuspiciousNameCombination", "UnnecessaryLocalVariable"}) // Imported code
public static BufferedImage createDropShadow(BufferedImage source, int shadowSize,
float shadowOpacity, int shadowRgb) {
+ if (shadowSize == 0) {
+ return source;
+ }
// This code is based on
// http://www.jroller.com/gfx/entry/non_rectangular_shadow