(gx, gy, gw, gh, occupied)
| 819 | |
| 820 | /* Determine if there is room available in the given dimension */ |
| 821 | var canFitText = function canFitText(gx, gy, gw, gh, occupied) { |
| 822 | // Go through the occupied points, |
| 823 | // return false if the space is not available. |
| 824 | var i = occupied.length; |
| 825 | while (i--) { |
| 826 | var px = gx + occupied[i][0]; |
| 827 | var py = gy + occupied[i][1]; |
| 828 | |
| 829 | if (px >= ngx || py >= ngy || px < 0 || py < 0) { |
| 830 | if (!settings.drawOutOfBound) { |
| 831 | return false; |
| 832 | } |
| 833 | continue; |
| 834 | } |
| 835 | |
| 836 | if (!grid[px][py]) { |
| 837 | return false; |
| 838 | } |
| 839 | } |
| 840 | return true; |
| 841 | }; |
| 842 | |
| 843 | /* Actually draw the text on the grid */ |
| 844 | var drawText = function drawText(gx, gy, info, word, weight, |
no outgoing calls
no test coverage detected