From 22cf0b0cb856336d36961280b1e968a91d4488d5 Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Thu, 11 Sep 2014 17:45:43 -0700 Subject: Unfilled shapes should not report themselves as opaque Issue #17470611 Stroked, unfilled GradientDrawable shouldn't cast a shadow Change-Id: Ied60e12c2d2567efec8dac1fe69c77b49ef25b8e --- graphics/java/android/graphics/drawable/GradientDrawable.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'graphics/java') diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java index 2c8611e794f6..e722690af8af 100644 --- a/graphics/java/android/graphics/drawable/GradientDrawable.java +++ b/graphics/java/android/graphics/drawable/GradientDrawable.java @@ -1637,6 +1637,11 @@ public class GradientDrawable extends Drawable { } } + // An unfilled shape is not opaque over bounds or shape + if (mColors == null && mColorStateList == null) { + return; + } + // Colors are opaque, so opaqueOverShape=true, mOpaqueOverShape = true; // and opaqueOverBounds=true if shape fills bounds -- cgit v1.2.3-59-g8ed1b