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:
@ -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()
|
||||
|
Reference in New Issue
Block a user