WIP #7226 Fix remove constraints (#7304)

* handle if graphSelections is empty

* fix removeConstrainingValuesInfo by using pathToNodes if available instead of selectionRanges: current selection should not be required to remove constraints

* selectionRanges not needed for removeConstrainingValuesInfo anymore

* fix remove constraint unit test: pass line's pathToNode instead of argument to remove constraint
This commit is contained in:
Andrew Varga
2025-06-06 01:16:11 +02:00
committed by GitHub
parent e116bbaae8
commit 8e6483a47b
4 changed files with 36 additions and 37 deletions

View File

@ -1252,18 +1252,11 @@ p3 = [342.51, 216.38],
if (err(callExp)) {
throw new Error('Failed to get CallExpressionKw node')
}
const constraintInfo = getConstraintInfoKw(
callExp.node,
codeManager.code,
artifact.codeRef.pathToNode,
filter
)
const constraint = constraintInfo[constraintIndex]
// Now that we're in sketchIdle state, test the "Constrain with named value" event
actor.send({
type: 'Constrain remove constraints',
data: constraint.pathToNode,
data: artifact.codeRef.pathToNode,
})
// Wait for the state to change in response to the constraint