Bug 1010739 - Change curve shape to be more consistent with Australis (r=margaret)
authorLucas Rocha <lucasr@mozilla.com>
Mon, 18 Aug 2014 10:40:07 +0100
changeset 200025 03b97b1ea39bfbb980f407a60a400ecb4e63cffd
parent 200024 45ed18e439d14cd5b3bc60170c54449c553f21b9
child 200026 0a0c695b4576da15069ccac5283f836eb5519716
push id8249
push userlrocha@mozilla.com
push dateMon, 18 Aug 2014 09:41:09 +0000
treeherderfx-team@b28df3d24a87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1010739
milestone34.0a1
Bug 1010739 - Change curve shape to be more consistent with Australis (r=margaret)
mobile/android/base/toolbar/ShapedButton.java
--- a/mobile/android/base/toolbar/ShapedButton.java
+++ b/mobile/android/base/toolbar/ShapedButton.java
@@ -54,29 +54,32 @@ public class ShapedButton extends Themed
 
     @Override
     protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) {
         super.onSizeChanged(width, height, oldWidth, oldHeight);
 
         if (mSide == CurveTowards.NONE)
             return;
 
-        final int curve = (int) (height * 1.125f);
-
         mPath.reset();
 
         if (mSide == CurveTowards.RIGHT) {
             mPath.moveTo(0, 0);
-            mPath.cubicTo(curve * 0.75f, 0,
-                          curve * 0.25f, height,
-                          curve, height);
+            mPath.cubicTo(height * 0.25f, 0.0f,
+                          height * 0.375f, height * 0.25f,
+                          height * 0.375f, height * 0.5f);
+            mPath.cubicTo(height * 0.375f, height * 0.72f,
+                          height * 0.527f, height * 0.961f,
+                          height * 0.729f, height);
             mPath.lineTo(width, height);
             mPath.lineTo(width, 0);
             mPath.lineTo(0, 0);
         } else if (mSide == CurveTowards.LEFT) {
+            final int curve = (int) (height * 1.125f);
+
             mPath.moveTo(width, 0);
             mPath.cubicTo((width - (curve * 0.75f)), 0,
                           (width - (curve * 0.25f)), height,
                           (width - curve), height);
             mPath.lineTo(0, height);
             mPath.lineTo(0, 0);
         }
     }