(canvas)
| 95 | }; |
| 96 | |
| 97 | function getContext(canvas) { |
| 98 | const context = canvas.getContext("2d", {willReadFrequently: true}); |
| 99 | |
| 100 | canvas.width = canvas.height = 1; |
| 101 | const ratio = Math.sqrt(context.getImageData(0, 0, 1, 1).data.length >> 2); |
| 102 | canvas.width = (cw << 5) / ratio; |
| 103 | canvas.height = ch / ratio; |
| 104 | |
| 105 | context.fillStyle = context.strokeStyle = "red"; |
| 106 | |
| 107 | return {context, ratio}; |
| 108 | } |
| 109 | |
| 110 | function place(board, tag, bounds) { |
| 111 | var perimeter = [{x: 0, y: 0}, {x: size[0], y: size[1]}], |
no outgoing calls
no test coverage detected
searching dependent graphs…