Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Jul 28, 2024
1 parent 2feeb45 commit 0bc1acb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
4 changes: 1 addition & 3 deletions src/lang/std/sketchcombos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1720,9 +1720,7 @@ function createSegLen(referenceSegName: string): Value {
}

function createSegAngle(referenceSegName: string): Value {
return createCallExpression('segAng', [
createIdentifier(referenceSegName),
])
return createCallExpression('segAng', [createIdentifier(referenceSegName)])
}

function createSegEnd(referenceSegName: string, isX: boolean): CallExpression {
Expand Down
16 changes: 4 additions & 12 deletions src/lib/rectangleTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ export const getRectangleCallExpressions = (
createCallExpressionStdLib('angledLine', [
createArrayExpression([
createBinaryExpression([
createCallExpressionStdLib('segAng', [
createIdentifier(tags[0]),
]),
createCallExpressionStdLib('segAng', [createIdentifier(tags[0])]),
'+',
createLiteral(90),
]), // 90 offset from the previous line
Expand All @@ -55,13 +53,9 @@ export const getRectangleCallExpressions = (
]),
createCallExpressionStdLib('angledLine', [
createArrayExpression([
createCallExpressionStdLib('segAng', [
createIdentifier(tags[0]),
]), // same angle as the first line
createCallExpressionStdLib('segAng', [createIdentifier(tags[0])]), // same angle as the first line
createUnaryExpression(
createCallExpressionStdLib('segLen', [
createIdentifier(tags[0]),
]),
createCallExpressionStdLib('segLen', [createIdentifier(tags[0])]),
'-'
), // negative height
]),
Expand Down Expand Up @@ -99,9 +93,7 @@ export function updateRectangleSketch(
;((pipeExpression.body[3] as CallExpression)
.arguments[0] as ArrayExpression) = createArrayExpression([
createBinaryExpression([
createCallExpressionStdLib('segAng', [
createIdentifier(tag),
]),
createCallExpressionStdLib('segAng', [createIdentifier(tag)]),
Math.sign(y) === Math.sign(x) ? '+' : '-',
createLiteral(90),
]), // 90 offset from the previous line
Expand Down
Binary file modified src/wasm-lib/kcl/tests/outputs/serial_test_example_line1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0bc1acb

Please sign in to comment.