OSDN Git Service

Fix for bug 7400445 regression in background drawable
authorRaph Levien <raph@google.com>
Wed, 31 Oct 2012 20:53:57 +0000 (13:53 -0700)
committerRaph Levien <raph@google.com>
Wed, 31 Oct 2012 20:59:02 +0000 (13:59 -0700)
commit39824f685c33f8aabbe9526b4cc79b7411e8b37f
tree82144e5bf92a1435019181142e58d1479dca80ac
parentf64e70fd045c2a786e3d3edf880d806e93beec3b
Fix for bug 7400445 regression in background drawable

The opacity calculation for a gradient drawable of shape must take
rounded corners into account - if the corner radius is nonzero, then the
shape is translucent rather than opaque. Previously the code always
assumed that such rectangles were fully opaque, which led to the
background (visible behind the rectangle) not getting drawn.

This patch simply checks for corner radius in addition to shape and
computes opacity as translucent in the nonzero case.

Change-Id: Iaf4d24abc6ecf49f85c82972b8f998700c83295e
graphics/java/android/graphics/drawable/GradientDrawable.java