From fd1f20a2f9bb9d840881e0084d27eb5c8c5cf304 Mon Sep 17 00:00:00 2001 From: Craig Michael Thompson Date: Tue, 2 Apr 2013 13:00:05 +0100 Subject: [PATCH] Fix calculateSize error that caused tips to have wrong dimensions --- src/tips/tips.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tips/tips.js b/src/tips/tips.js index db1f6b8d..20abf5cc 100644 --- a/src/tips/tips.js +++ b/src/tips/tips.js @@ -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(); }