don't query program memory for add sketch line (#895)
* don't query program memory for add sketch line * add issue TODO * fmt * fix test tsc
This commit is contained in:
@ -193,9 +193,6 @@ export const line: SketchLineHelper = {
|
||||
pathToNode,
|
||||
'VariableDeclarator'
|
||||
)
|
||||
const variableName = varDec.id.name
|
||||
const sketch = previousProgramMemory?.root?.[variableName]
|
||||
if (sketch.type !== 'SketchGroup') throw new Error('not a SketchGroup')
|
||||
|
||||
const newXVal = createLiteral(roundOff(to[0] - from[0], 2))
|
||||
const newYVal = createLiteral(roundOff(to[1] - from[1], 2))
|
||||
@ -969,7 +966,8 @@ export function addNewSketchLn({
|
||||
to,
|
||||
fnName,
|
||||
pathToNode,
|
||||
}: Omit<CreateLineFnCallArgs, 'from'>): {
|
||||
from,
|
||||
}: CreateLineFnCallArgs): {
|
||||
modifiedAst: Program
|
||||
pathToNode: PathToNode
|
||||
} {
|
||||
@ -984,12 +982,6 @@ export function addNewSketchLn({
|
||||
const { node: pipeExp, shallowPath: pipePath } = getNodeFromPath<
|
||||
PipeExpression | CallExpression
|
||||
>(node, pathToNode, 'PipeExpression')
|
||||
const variableName = varDec.id.name
|
||||
const sketch = previousProgramMemory?.root?.[variableName]
|
||||
if (sketch.type !== 'SketchGroup') throw new Error('not a SketchGroup')
|
||||
|
||||
const last = sketch.value[sketch.value.length - 1] || sketch.start
|
||||
const from = last.to
|
||||
return add({
|
||||
node,
|
||||
previousProgramMemory,
|
||||
|
Reference in New Issue
Block a user