(event)
| 1149 | } |
| 1150 | |
| 1151 | applyPointer(event) { |
| 1152 | const element = document.elementFromPoint(event.clientX, event.clientY); |
| 1153 | if (!element) return; |
| 1154 | const cell = element.closest("[data-index]"); |
| 1155 | if (!cell) return; |
| 1156 | const index = Number(cell.dataset.index); |
| 1157 | if (Number.isNaN(index)) return; |
| 1158 | this.paintCell(index, this.activeMode === "erase"); |
| 1159 | } |
| 1160 | |
| 1161 | paintCell(index, erase = false) { |
| 1162 | const row = Math.floor(index / this.cols); |
no test coverage detected