Merge "Fix crash when shadowSize is 0"

This commit is contained in:
Diego Perez
2015-03-05 10:13:00 +00:00
committed by Android (Google) Code Review

View File

@@ -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