perpendicular distance & remove constraint - constraint fixes (#2579)
* perpendicular distance constraint * remove constraints fix
This commit is contained in:
@ -140,7 +140,11 @@ export async function applyConstraintIntersect({
|
||||
value: valueUsedInTransform,
|
||||
initialVariableName: 'offset',
|
||||
})
|
||||
if (segName === tagInfo?.tag && Number(value) === valueUsedInTransform) {
|
||||
if (
|
||||
!variableName &&
|
||||
segName === tagInfo?.tag &&
|
||||
Number(value) === valueUsedInTransform
|
||||
) {
|
||||
return {
|
||||
modifiedAst,
|
||||
pathToNodeMap,
|
||||
@ -169,6 +173,10 @@ export async function applyConstraintIntersect({
|
||||
createVariableDeclaration(variableName, valueNode)
|
||||
)
|
||||
_modifiedAst.body = newBody
|
||||
Object.values(_pathToNodeMap).forEach((pathToNode) => {
|
||||
const index = pathToNode.findIndex((a) => a[0] === 'body') + 1
|
||||
pathToNode[index][0] = Number(pathToNode[index][0]) + 1
|
||||
})
|
||||
}
|
||||
return {
|
||||
modifiedAst: _modifiedAst,
|
||||
|
Reference in New Issue
Block a user