Refactor mouse event args (#1613)

* refactor mouse event interfaces

Importantly returning multiple intersections from raycastRing, but other clean up

* refactor enter exit args interface

* type tweak
This commit is contained in:
Kurt Hutten
2024-03-03 16:23:16 +11:00
committed by GitHub
parent fedffbb384
commit 223b5952aa
3 changed files with 169 additions and 151 deletions

View File

@ -829,13 +829,13 @@ export const modelingMachine = createMachine(
sceneInfra.setCallbacks({
onClick: async (args) => {
if (!args) return
if (args.event.which !== 1) return
const { intersection2d } = args
if (!intersection2d || !sketchPathToNode) return
if (args.mouseEvent.which !== 1) return
const { intersectionPoint } = args
if (!intersectionPoint?.twoD || !sketchPathToNode) return
const { modifiedAst } = addStartProfileAt(
kclManager.ast,
sketchPathToNode,
[intersection2d.x, intersection2d.y]
[intersectionPoint.twoD.x, intersectionPoint.twoD.y]
)
await kclManager.updateAst(modifiedAst, false)
sceneEntitiesManager.removeIntersectionPlane()