From f4baaa94171f32137ee315e412712ae8e8f6b4ad Mon Sep 17 00:00:00 2001 From: jos Date: Wed, 6 Apr 2016 14:24:56 +0200 Subject: [PATCH] Fixed stacking not working (due to a small bug in the PR for rtl support) --- lib/timeline/Stack.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/timeline/Stack.js b/lib/timeline/Stack.js index b1b8fb03..fa8a47e9 100644 --- a/lib/timeline/Stack.js +++ b/lib/timeline/Stack.js @@ -111,20 +111,19 @@ exports.nostack = function(items, margin, subgroups) { * @param {{horizontal: number, vertical: number}} margin * An object containing a horizontal and vertical * minimum required margin. + * @param {boolean} rtl * @return {boolean} true if a and b collide, else false */ exports.collision = function(a, b, margin, rtl) { - var isCollision = null; if (rtl) { - isCollision = ((a.right - margin.horizontal + EPSILON) < (b.right + b.width) && + return ((a.right - margin.horizontal + EPSILON) < (b.right + b.width) && (a.right + a.width + margin.horizontal - EPSILON) > b.right && (a.top - margin.vertical + EPSILON) < (b.top + b.height) && (a.top + a.height + margin.vertical - EPSILON) > b.top); } else { - ((a.left - margin.horizontal + EPSILON) < (b.left + b.width) && + return ((a.left - margin.horizontal + EPSILON) < (b.left + b.width) && (a.left + a.width + margin.horizontal - EPSILON) > b.left && (a.top - margin.vertical + EPSILON) < (b.top + b.height) && (a.top + a.height + margin.vertical - EPSILON) > b.top); } - return isCollision; };