Skip to content

Commit

Permalink
Fixed stacking not working (due to a small bug in the PR for rtl supp…
Browse files Browse the repository at this point in the history
…ort)
  • Loading branch information
josdejong committed Apr 6, 2016
1 parent 8757b43 commit f4baaa9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/timeline/Stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

0 comments on commit f4baaa9

Please sign in to comment.