focus on extrude literal when extruding sketch

This commit is contained in:
Kurt Hutten Irev-Dev
2023-01-13 17:58:37 +11:00
parent bd9dab8a29
commit 9ec332d681
6 changed files with 163 additions and 94 deletions

View File

@ -55,7 +55,10 @@ function MovingSphere({
const { originalXY } = useMemo(() => {
if (ast) {
const thePath = getNodePathFromSourceRange(ast, sourceRange)
const callExpression = getNodeFromPath(ast, thePath) as CallExpression
const { node: callExpression } = getNodeFromPath<CallExpression>(
ast,
thePath
)
const [xArg, yArg] = callExpression?.arguments || []
const x = xArg?.type === 'Literal' ? xArg.value : -1
const y = yArg?.type === 'Literal' ? yArg.value : -1