fix single selection angle constraint (#2555)

* fix single selection angle constraint

* fix angle for multi selections

* make test more robust for makos
This commit is contained in:
Kurt Hutten
2024-05-31 11:36:08 +10:00
committed by GitHub
parent 8c3af1a72a
commit bd16902f02
10 changed files with 262 additions and 11 deletions

View File

@ -26,6 +26,22 @@ export function pathMapToSelections(
return newSelections
}
export function updatePathToNodeFromMap(
oldPath: PathToNode,
pathToNodeMap: { [key: number]: PathToNode }
): PathToNode {
const updatedPathToNode = JSON.parse(JSON.stringify(oldPath))
let max = 0
Object.values(pathToNodeMap).forEach((path) => {
const index = Number(path[1][0])
if (index > max) {
max = index
}
})
updatedPathToNode[1][0] = max
return updatedPathToNode
}
export function isCursorInSketchCommandRange(
artifactMap: ArtifactMap,
selectionRanges: Selections