Skip to content

Commit b4cda14

Browse files
committed
simplified the distribute function to one param
1 parent cc126e4 commit b4cda14

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function render(locker) {
3232
combos.forEach(ele => ele.remove());
3333

3434
// Redistribute zones generically
35-
zones.distribute(5, 5);
35+
zones.distribute(5);
3636
}
3737

3838
zones.render()

lib/zones.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,15 @@ export function getValidInsertionPoints() {
210210
/*
211211
* Distributes zones generically using vips
212212
* @param map {Map} the map to alter
213-
* @param start {integer} the first position
214213
* @param tick {integer} the cadence
215214
*/
216215

217-
export function distribute(start = 3, tick = 4) {
216+
export function distribute(tick = 4) {
218217
const vips = getValidInsertionPoints();
219218

220219
map.forEach(zone => {
221-
zone.vip = vips[start];
222-
start += tick;
220+
zone.vip = vips[tick];
221+
tick += tick;
223222
});
224223
}
225224

0 commit comments

Comments
 (0)