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:
@@ -510,6 +510,26 @@ export const FenceTool: React.FC = () => {
|
|||||||
startingPoint.current.set(nextStart[0], event.localPosition[1], nextStart[1])
|
startingPoint.current.set(nextStart[0], event.localPosition[1], nextStart[1])
|
||||||
endingPoint.current.copy(startingPoint.current)
|
endingPoint.current.copy(startingPoint.current)
|
||||||
cursorRef.current?.position.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:move', onGridMove)
|
||||||
emitter.on('grid:click', onGridClick)
|
emitter.on('grid:click', onGridClick)
|
||||||
|
|||||||
Reference in New Issue
Block a user