(_event: GridEvent)
| 187 | } |
| 188 | |
| 189 | const onGridClick = (_event: GridEvent) => { |
| 190 | if (!currentLevelId) return |
| 191 | const clickPoint = previousSnappedPointRef.current ?? cursorPosition |
| 192 | const firstPoint = points[0] |
| 193 | if ( |
| 194 | points.length >= 3 && |
| 195 | firstPoint && |
| 196 | Math.abs(clickPoint[0] - firstPoint[0]) < 0.25 && |
| 197 | Math.abs(clickPoint[1] - firstPoint[1]) < 0.25 |
| 198 | ) { |
| 199 | const ceilingId = commitCeilingDrawing(currentLevelId, points) |
| 200 | setSelection({ selectedIds: [ceilingId] }) |
| 201 | setPoints([]) |
| 202 | useAlignmentGuides.getState().clear() |
| 203 | } else { |
| 204 | // Every non-closing vertex is a "start" tick; the closing click above |
| 205 | // fires the structure-build (end) cue. |
| 206 | triggerSFX('sfx:structure-build-start') |
| 207 | setPoints([...points, clickPoint]) |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | const onGridDoubleClick = (_event: GridEvent) => { |
| 212 | if (!currentLevelId) return |
nothing calls this directly
no test coverage detected
searching dependent graphs…