()
| 60 | return cloud; |
| 61 | |
| 62 | function step() { |
| 63 | var start = Date.now(); |
| 64 | while (Date.now() - start < timeInterval && ++i < n && timer) { |
| 65 | var d = data[i]; |
| 66 | d.x = (size[0] * (random() + .5)) >> 1; |
| 67 | d.y = (size[1] * (random() + .5)) >> 1; |
| 68 | cloudSprite(contextAndRatio, d, data, i); |
| 69 | if (d.hasText && place(board, d, bounds)) { |
| 70 | tags.push(d); |
| 71 | event.call("word", cloud, d); |
| 72 | if (bounds) cloudBounds(bounds, d); |
| 73 | else bounds = [{x: d.x + d.x0, y: d.y + d.y0}, {x: d.x + d.x1, y: d.y + d.y1}]; |
| 74 | // Temporary hack |
| 75 | d.x -= size[0] >> 1; |
| 76 | d.y -= size[1] >> 1; |
| 77 | } |
| 78 | } |
| 79 | if (i >= n) { |
| 80 | cloud.stop(); |
| 81 | event.call("end", cloud, tags, bounds); |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | cloud.stop = function() { |
no test coverage detected
searching dependent graphs…