Skip to content

Commit 0143ff2

Browse files
update
1 parent ae578a8 commit 0143ff2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/components/primitive-components/CourtyardRect.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { decomposeTSR } from "transformation-matrix"
12
import { PrimitiveComponent } from "../base-components/PrimitiveComponent"
23
import { courtyardRectProps } from "@tscircuit/props"
34

@@ -34,8 +35,10 @@ export class CourtyardRect extends PrimitiveComponent<
3435
this.parent?.pcb_component_id ??
3536
this.getPrimitiveContainer()?.pcb_component_id!
3637

37-
const transform = this._computePcbGlobalTransformBeforeLayout()
38-
const ccw_rotation = (Math.atan2(transform.b, transform.a) * 180) / Math.PI
38+
const decomposedTransform = decomposeTSR(
39+
this._computePcbGlobalTransformBeforeLayout(),
40+
)
41+
const ccw_rotation = (decomposedTransform.rotation.angle * 180) / Math.PI
3942

4043
const pcb_courtyard_rect = db.pcb_courtyard_rect.insert({
4144
pcb_component_id,

0 commit comments

Comments
 (0)