Browse Source

Fixed stacking not working (due to a small bug in the PR for rtl support)

codeClimate
jos 8 years ago
parent
commit
f4baaa9417
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      lib/timeline/Stack.js

+ 3
- 4
lib/timeline/Stack.js View File

@ -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;
};

Loading…
Cancel
Save