From 4831f6bdf79536fe44deed3024bb2785dd122ac4 Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Thu, 25 Apr 2013 12:20:21 +0100 Subject: [PATCH] Bug 858978 - Use DST_IN to draw ShapedButton (r=mfinkle) --- mobile/android/base/ShapedButton.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mobile/android/base/ShapedButton.java b/mobile/android/base/ShapedButton.java index 81d20722ecdd..36067f8d8758 100644 --- a/mobile/android/base/ShapedButton.java +++ b/mobile/android/base/ShapedButton.java @@ -43,7 +43,7 @@ public class ShapedButton extends GeckoImageButton // Path is clipped. mPath = new Path(); - mCanvasDelegate = new CanvasDelegate(this, Mode.DST_OUT); + mCanvasDelegate = new CanvasDelegate(this, Mode.DST_IN); setWillNotDraw(false); } @@ -66,15 +66,16 @@ public class ShapedButton extends GeckoImageButton mPath.cubicTo(curve * 0.75f, 0, curve * 0.25f, height, curve, height); - mPath.lineTo(0, height); + mPath.lineTo(width, height); + mPath.lineTo(width, 0); mPath.lineTo(0, 0); } else if (mSide == CurveTowards.LEFT) { mPath.moveTo(width, 0); mPath.cubicTo((width - (curve * 0.75f)), 0, (width - (curve * 0.25f)), height, (width - curve), height); - mPath.lineTo(width, height); - mPath.lineTo(width, 0); + mPath.lineTo(0, height); + mPath.lineTo(0, 0); } }