Merge pull request #318 from pascalorg/fix/fence-tool-handlers

fix: restore fence tool handlers dropped by null-guard commit
This commit is contained in:
Wassim SAMAD
2026-05-20 08:17:46 -04:00
committed by GitHub
+20
View File
@@ -510,6 +510,26 @@ export const FenceTool: React.FC = () => {
startingPoint.current.set(nextStart[0], event.localPosition[1], nextStart[1])
endingPoint.current.copy(startingPoint.current)
cursorRef.current?.position.copy(startingPoint.current)
previewRef.current.visible = false
buildingState.current = 1
setDraftMeasurement(null)
}
}
const onKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Shift') shiftPressed.current = true
}
const onKeyUp = (e: KeyboardEvent) => {
if (e.key === 'Shift') shiftPressed.current = false
}
const onCancel = () => {
if (buildingState.current === 1) {
markToolCancelConsumed()
stopDrafting()
}
}
emitter.on('grid:move', onGridMove)
emitter.on('grid:click', onGridClick)