Add common angles are permanent variables, 0, 90,180 etc (#89)

This commit is contained in:
Kurt Hutten
2023-04-01 21:25:00 +11:00
committed by GitHub
parent 61533fb306
commit 252ace6d69
2 changed files with 24 additions and 1 deletions

View File

@ -350,9 +350,12 @@ const setAngledIntersectLineForLines: TransformInfo['createNode'] =
2
)
const angle = args[0].type === 'Literal' ? Number(args[0].value) : 0
const angleVal = [0, 90, 180, 270].includes(angle)
? createIdentifier(`_${angle}`)
: createLiteral(angle)
return intersectCallWrapper({
fnName: 'angledLineThatIntersects',
angleVal: createLiteral(angle),
angleVal,
offsetVal:
forceValueUsedInTransform || createLiteral(valueUsedInTransform),
intersectTag: createLiteral(referenceSegName),