OSDN Git Service

setCornerRadii should be called when either of corners radius is specified
authorviral.vkm <viral.vkm@gmail.com>
Thu, 25 Mar 2010 12:20:57 +0000 (17:50 +0530)
committerviral.vkm <viral.vkm@gmail.com>
Thu, 25 Mar 2010 12:20:57 +0000 (17:50 +0530)
as 0dp and thus while checking for condition, it should be ORed and not ANDed.

It solves Android Issue: 939
http://code.google.com/p/android/issues/detail?id=939

Change-Id: Ic18fae769480972f763f634e7462c6ed3853220b

graphics/java/android/graphics/drawable/GradientDrawable.java

index 91a2bc1..63d1446 100644 (file)
@@ -778,8 +778,8 @@ public class GradientDrawable extends Drawable {
                         com.android.internal.R.styleable.DrawableCorners_bottomLeftRadius, radius);
                 int bottomRightRadius = a.getDimensionPixelSize(
                         com.android.internal.R.styleable.DrawableCorners_bottomRightRadius, radius);
-                if (topLeftRadius != radius && topRightRadius != radius &&
-                        bottomLeftRadius != radius && bottomRightRadius != radius) {
+                if (topLeftRadius != radius || topRightRadius != radius ||
+                        bottomLeftRadius != radius || bottomRightRadius != radius) {
                     setCornerRadii(new float[] {
                             topLeftRadius, topLeftRadius,
                             topRightRadius, topRightRadius,