From 27c1d2a4e2274c45942450b75534f2f465adf58d Mon Sep 17 00:00:00 2001 From: Andrew Solovay Date: Mon, 21 Dec 2015 12:26:06 -0800 Subject: [PATCH] Corrected code snippet for reveal effect Per bug report, the provided code doesn't draw the reveal properly. Corrected to use the Math.hypot function to calculate beginning and ending sizes. See first comment for doc stage location. bug: 25805924 Change-Id: I1eb832983ae1790262cc4c8051473f0f32115566 --- docs/html/training/material/animations.jd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/html/training/material/animations.jd b/docs/html/training/material/animations.jd index 6f263dba57d12..2db621afaaeb0 100644 --- a/docs/html/training/material/animations.jd +++ b/docs/html/training/material/animations.jd @@ -85,7 +85,7 @@ int cx = myView.getWidth() / 2; int cy = myView.getHeight() / 2; // get the final radius for the clipping circle -int finalRadius = Math.max(myView.getWidth(), myView.getHeight()); +float finalRadius = (float) Math.hypot(cx, cy); // create the animator for this view (the start radius is zero) Animator anim = @@ -107,7 +107,7 @@ int cx = myView.getWidth() / 2; int cy = myView.getHeight() / 2; // get the initial radius for the clipping circle -int initialRadius = myView.getWidth(); +float initialRadius = (float) Math.hypot(cx, cy); // create the animation (the final radius is zero) Animator anim =