Revert multi-profile (#4812)
* Revert "multi-profile follow up. (#4802)" This reverts commit2b2ed470c1
. * Revert "multi profile (#4532)" This reverts commit04e586d07b
. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * Re-run CI after snapshots * Re-run CI after snapshots * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores) * Re-run CI after snapshots * Add `fixme` to onboarding test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -29,7 +29,7 @@ import {
|
||||
*/
|
||||
export const getRectangleCallExpressions = (
|
||||
rectangleOrigin: [number, number],
|
||||
tag: string
|
||||
tags: [string, string, string]
|
||||
) => [
|
||||
createCallExpressionStdLib('angledLine', [
|
||||
createArrayExpression([
|
||||
@ -37,28 +37,30 @@ export const getRectangleCallExpressions = (
|
||||
createLiteral(0), // This will be the width of the rectangle
|
||||
]),
|
||||
createPipeSubstitution(),
|
||||
createTagDeclarator(tag),
|
||||
createTagDeclarator(tags[0]),
|
||||
]),
|
||||
createCallExpressionStdLib('angledLine', [
|
||||
createArrayExpression([
|
||||
createBinaryExpression([
|
||||
createCallExpressionStdLib('segAng', [createIdentifier(tag)]),
|
||||
createCallExpressionStdLib('segAng', [createIdentifier(tags[0])]),
|
||||
'+',
|
||||
createLiteral(90),
|
||||
]), // 90 offset from the previous line
|
||||
createLiteral(0), // This will be the height of the rectangle
|
||||
]),
|
||||
createPipeSubstitution(),
|
||||
createTagDeclarator(tags[1]),
|
||||
]),
|
||||
createCallExpressionStdLib('angledLine', [
|
||||
createArrayExpression([
|
||||
createCallExpressionStdLib('segAng', [createIdentifier(tag)]), // same angle as the first line
|
||||
createCallExpressionStdLib('segAng', [createIdentifier(tags[0])]), // same angle as the first line
|
||||
createUnaryExpression(
|
||||
createCallExpressionStdLib('segLen', [createIdentifier(tag)]),
|
||||
createCallExpressionStdLib('segLen', [createIdentifier(tags[0])]),
|
||||
'-'
|
||||
), // negative height
|
||||
]),
|
||||
createPipeSubstitution(),
|
||||
createTagDeclarator(tags[2]),
|
||||
]),
|
||||
createCallExpressionStdLib('lineTo', [
|
||||
createArrayExpression([
|
||||
@ -83,12 +85,12 @@ export function updateRectangleSketch(
|
||||
y: number,
|
||||
tag: string
|
||||
) {
|
||||
;((pipeExpression.body[1] as CallExpression)
|
||||
;((pipeExpression.body[2] as CallExpression)
|
||||
.arguments[0] as ArrayExpression) = createArrayExpression([
|
||||
createLiteral(x >= 0 ? 0 : 180),
|
||||
createLiteral(Math.abs(x)),
|
||||
])
|
||||
;((pipeExpression.body[2] as CallExpression)
|
||||
;((pipeExpression.body[3] as CallExpression)
|
||||
.arguments[0] as ArrayExpression) = createArrayExpression([
|
||||
createBinaryExpression([
|
||||
createCallExpressionStdLib('segAng', [createIdentifier(tag)]),
|
||||
@ -118,7 +120,7 @@ export function updateCenterRectangleSketch(
|
||||
let startY = originY - Math.abs(deltaY)
|
||||
|
||||
// pipeExpression.body[1] is startProfileAt
|
||||
let callExpression = pipeExpression.body[0]
|
||||
let callExpression = pipeExpression.body[1]
|
||||
if (isCallExpression(callExpression)) {
|
||||
const arrayExpression = callExpression.arguments[0]
|
||||
if (isArrayExpression(arrayExpression)) {
|
||||
@ -132,7 +134,7 @@ export function updateCenterRectangleSketch(
|
||||
const twoX = deltaX * 2
|
||||
const twoY = deltaY * 2
|
||||
|
||||
callExpression = pipeExpression.body[1]
|
||||
callExpression = pipeExpression.body[2]
|
||||
if (isCallExpression(callExpression)) {
|
||||
const arrayExpression = callExpression.arguments[0]
|
||||
if (isArrayExpression(arrayExpression)) {
|
||||
@ -146,7 +148,7 @@ export function updateCenterRectangleSketch(
|
||||
}
|
||||
}
|
||||
|
||||
callExpression = pipeExpression.body[2]
|
||||
callExpression = pipeExpression.body[3]
|
||||
if (isCallExpression(callExpression)) {
|
||||
const arrayExpression = callExpression.arguments[0]
|
||||
if (isArrayExpression(arrayExpression)) {
|
||||
|
Reference in New Issue
Block a user