Skip to content

Commit

Permalink
temp fix for the ground label symbol text posision
Browse files Browse the repository at this point in the history
  • Loading branch information
Abse2001 committed Dec 24, 2024
1 parent be2547d commit f359e0e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/utils/net-label-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export function getTextOffsets(pathRotation: number, transform: Matrix) {

const rotationOffsetMap: Record<string, { x: number; y: number }> = {
"0": { x: baseOffset * 0.8, y: -baseOffset }, // Left
"-90": { x: baseOffset * 3.3, y: baseOffset * 2.8 }, // Top
"90": { x: -baseOffset * 3.55, y: -baseOffset * 4.2 }, // Bottom
"-90": { x: baseOffset * -3.5, y: baseOffset * 2.8 }, // Top
"90": { x: -baseOffset * -3.55, y: -baseOffset * 4.2 }, // Bottom
"180": { x: -baseOffset * 0.85, y: -baseOffset * 0.2 }, // Right
}

Expand Down
2 changes: 1 addition & 1 deletion tests/sch/__snapshots__/net-symbol-grid.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions tests/sch/__snapshots__/net-symbol.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/sch/net-symbol.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect } from "bun:test"
import { convertCircuitJsonToSchematicSvg } from "lib"
import { Circuit } from "@tscircuit/core"
// this test needs core update and PR to support net symbols
test.skip("schematic net symbol", () => {
test("schematic net symbol", () => {
const circuit = new Circuit()

circuit.add(
Expand Down

0 comments on commit f359e0e

Please sign in to comment.