From 2a6d67b17a0514004400c001fa0a6fd918480a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=88king?= Date: Wed, 17 Oct 2012 22:21:57 -0500 Subject: [PATCH] Allow widthMultiplier. --- jquery.roundabout.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/jquery.roundabout.js b/jquery.roundabout.js index df83da2..4240563 100644 --- a/jquery.roundabout.js +++ b/jquery.roundabout.js @@ -47,9 +47,9 @@ $.extend({ roundaboutShapes: { def: "lazySusan", - lazySusan: function (r, a, t) { + lazySusan: function (r, a, t, w) { return { - x: Math.sin(r + a), + x: Math.sin(r + a) * w, y: (Math.sin(r + 3 * Math.PI / 2 + a) / 8) * t, z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI / 2 + a) / 2) + 0.5 @@ -398,7 +398,8 @@ animating: data.animating, inFocus: data.childInFocus, focusBearingRadian: methods.degToRad.apply(null, [data.focusBearing]), - shape: $.roundaboutShapes[data.shape] || $.roundaboutShapes[$.roundaboutShapes.def] + shape: $.roundaboutShapes[data.shape] || $.roundaboutShapes[$.roundaboutShapes.def], + widthMultiplier: data.widthMultiplier || 1.0 }; // calculations @@ -480,7 +481,7 @@ rad = methods.normalizeRad.apply(null, [rad]); // get factors from shape - factors = info.shape(rad, info.focusBearingRadian, info.tilt); + factors = info.shape(rad, info.focusBearingRadian, info.tilt, info.widthMultiplier); // correct factors.scale = (factors.scale > 1) ? 1 : factors.scale; @@ -1193,4 +1194,4 @@ $.error("Method " + method + " does not exist for jQuery.roundabout."); } }; -})(jQuery); \ No newline at end of file +})(jQuery);