Actions
Improvement #1412
closedImprove spawning algorithm to spawn in all board instead of circle
Description
Test:
function calcNextLayer() {
prevLayer++;
const layerMaxItemsPerLine = (-1 + prevLayer * 4);
const layerMaxItemsPerColumn = (-1 + prevLayer * 2);
/*
f(1) = (1/1)
f(2) = (5/3)
f(3) = (9/5)
f(4) = (13/7)
f(5) = (17/9)
*/
const newPoints = [];
for(let itemX = 0; itemX < layerMaxItemsPerLine; itemX++) {
for(let itemY = 0; itemY < layerMaxItemsPerColumn; itemY++) {
let x = (-0.5 * layerMaxItemsPerLine + itemX + 0.5) * itemsFinalDistance + itemsFinalDistance / 2;
let y = (-0.5 * layerMaxItemsPerColumn + itemY + 0.5) * itemsFinalDistance + itemsFinalDistance / 2;
if(!positions.find(p => p.x === x && p.y === y)) {
newPoints.push({ x, y });
}
/*if(itemY === 0 || itemY === (layerMaxItemsPerColumn - 1) || itemX === 0 || itemX === (layerMaxItemsPerLine - 1)) {
newPoints.push({
x: (-0.5 * layerMaxItemsPerLine + itemX + 0.5) * itemsFinalDistance,
y: (-0.5 * layerMaxItemsPerColumn + itemY + 0.5) * itemsFinalDistance,
});
}*/
}
}
positions = [...positions, ...newPoints];
console.log(newPoints);
return newPoints;
}
Updated by Axel "Elanis" Soupé over 2 years ago
- Translation missing: en.field_story_points set to 10
Updated by Axel "Elanis" Soupé 8 months ago
- Subject changed from Move origin spawn point of elements to Improve spawning algorithm to spawn in all board instead of circle
- Target version changed from Z - Backlog to Phosphorus
Updated by Axel "Elanis" Soupé 7 months ago
- Status changed from Pending to Closed
- Target version changed from Phosphorus to Silicium
I ended up keeping the circle but improving the algorithm
Actions