Skip to content

Commit

Permalink
More precise calculation of final radius in readme.md file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergej Shafarenka committed Oct 27, 2015
1 parent 4e967c3 commit ab05d16
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 ab05d16

Please sign in to comment.