From ab05d163841bb022a2e332fe096bdf0510a9f471 Mon Sep 17 00:00:00 2001 From: Sergej Shafarenka Date: Tue, 27 Oct 2015 12:38:19 +0100 Subject: [PATCH] More precise calculation of final radius in readme.md file. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c8a14f0..e9acbaf 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,9 @@ Use regular `RevealFrameLayout` & `RevealLinearLayout` don't worry, only target int cy = (myView.getTop() + myView.getBottom()) / 2; // get the final radius for the clipping circle - int finalRadius = Math.max(myView.getWidth(), myView.getHeight()); + int dx = Math.max(cx, myView.getWidth() - cx); + int dy = Math.max(cy, myView.getHeight() - cy); + float finalRadius = (float) Math.hypot(dx, dy); SupportAnimator animator = ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);