diff --git a/lib/components/base-components/NormalComponent/NormalComponent.ts b/lib/components/base-components/NormalComponent/NormalComponent.ts index 287ba5061..e2acc768a 100644 --- a/lib/components/base-components/NormalComponent/NormalComponent.ts +++ b/lib/components/base-components/NormalComponent/NormalComponent.ts @@ -1448,9 +1448,15 @@ export class NormalComponent< const computedLayer = this.props.layer === "bottom" ? "bottom" : "top" + const pcbComponent = db.pcb_component.get(this.pcb_component_id) const globalTransform = this._computePcbGlobalTransformBeforeLayout() const decomposedTransform = decomposeTSR(globalTransform) - const totalRotation = (decomposedTransform.rotation.angle * 180) / Math.PI + const preLayoutRotation = + (decomposedTransform.rotation.angle * 180) / Math.PI + const totalRotation = + pcbComponent?.position_mode === "packed" + ? (pcbComponent.rotation ?? preLayoutRotation) + : preLayoutRotation const isBottomLayer = computedLayer === "bottom" const rotationWithOffset = totalRotation + (rotationOffset.z ?? 0) diff --git a/tests/fixtures/__snapshots__/model-orientation-circuit-simple-3d.snap.png b/tests/fixtures/__snapshots__/model-orientation-circuit-simple-3d.snap.png index 36c376079..badc205a7 100644 Binary files a/tests/fixtures/__snapshots__/model-orientation-circuit-simple-3d.snap.png and b/tests/fixtures/__snapshots__/model-orientation-circuit-simple-3d.snap.png differ