Sort selections in order of appearance before applying transformSecondarySketchLinesTagFirst

This commit is contained in:
Frank Noirot
2024-10-10 20:32:35 -04:00
parent 9563bd322c
commit b1ccc6df0f

View File

@ -1559,7 +1559,9 @@ export function transformSecondarySketchLinesTagFirst({
}
| Error {
// let node = structuredClone(ast)
const primarySelection = selectionRanges.codeBasedSelections[0].range
const primarySelection = selectionRanges.codeBasedSelections.sort(
(a, b) => a.range[0] - b.range[0]
)[0].range
const _tag = giveSketchFnCallTag(ast, primarySelection, forceSegName)
if (err(_tag)) return _tag