Skip to content

Commit

Permalink
Merge pull request #55 from beworker/beworker-final-radius-improvement
Browse files Browse the repository at this point in the history
More precise calculation of final radius in readme.md file.
  • Loading branch information
ozodrukh committed Oct 27, 2015
2 parents 4e967c3 + ab05d16 commit 6dd58c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6dd58c9

Please sign in to comment.