Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Fix calculateSize error that caused tips to have wrong dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Apr 2, 2013
1 parent b25bdc3 commit fd1f20a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tips/tips.js
Expand Up @@ -66,15 +66,15 @@ function calculateSize(size, corner, border) {
bigHyp, ratio, result,

smallHyp = Math.sqrt( pow(base, 2) + pow(height, 2) ),

hyp = [ (border / base) * smallHyp, (border / height) * smallHyp ];

hyp[2] = Math.sqrt( pow(hyp[0], 2) - pow(border, 2) );
hyp[3] = Math.sqrt( pow(hyp[1], 2) - pow(border, 2) );

bigHyp = smallHyp + hyp[2] + hyp[3] + (isCenter ? 0 : hyp[0]);
ratio = bigHyp / smallHyp;

result = [ round(ratio * height), round(ratio * width) ];
result = [ round(ratio * width), round(ratio * height) ];
return y ? result : result.reverse();
}

Expand Down

0 comments on commit fd1f20a

Please sign in to comment.