Open vishakhadamle opened 7 years ago
I made small modifications to the source to achieve this. First allow passing of a word buffer variable
scope: {
words: '=',
onClick: '&',
hasLinks: '=',
buffer: '=?'
},
Then assign a default buffer value if none has been set
if (angular.isUndefined(scope.buffer)) {
scope.buffer = 0;
}
Then use the buffer in the collision detection
function collisionDetected(spot, takenSpot) {
if (spot.startX > takenSpot.endX + scope.buffer || spot.endX < takenSpot.startX - scope.buffer) {
return false;
}
return !(spot.startY > takenSpot.endY + scope.buffer || spot.endY < takenSpot.startY - scope.buffer);
}
Is there any way to increase the spacing between the words? They are too close together for my use case.