Skip to content

Commit

Permalink
fix: fixed the top and bottom anchor position
Browse files Browse the repository at this point in the history
  • Loading branch information
imrishabh18 committed Nov 13, 2024
1 parent 6669599 commit 1ff83b8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
10 changes: 5 additions & 5 deletions lib/sch/svg-object-fns/create-svg-objects-for-sch-net-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export const createSvgObjectsForSchNetLabel = (
// Get rotation angle based on anchor_side
const pathRotation = {
left: 0,
top: -90,
bottom: 90,
top: 90,
bottom: -90,
right: 180,
}[schNetLabel.anchor_side]

Expand Down Expand Up @@ -156,7 +156,7 @@ export const createSvgObjectsForSchNetLabel = (

const screenTextPos = {
x: screenAnchorPosition.x + screenTextGrowthVec.x * fontSizePx * 0.5,
y: screenAnchorPosition.y + screenTextGrowthVec.y * fontSizePx * 0.5,
y: screenAnchorPosition.y - screenTextGrowthVec.y * fontSizePx * 0.5,
}

const textAnchor = {
Expand All @@ -169,8 +169,8 @@ export const createSvgObjectsForSchNetLabel = (
const textTransformString = {
left: "",
right: "",
top: `rotate(90 ${screenTextPos.x} ${screenTextPos.y})`,
bottom: `rotate(-90 ${screenTextPos.x} ${screenTextPos.y})`,
top: `rotate(-90 ${screenTextPos.x} ${screenTextPos.y})`,
bottom: `rotate(90 ${screenTextPos.x} ${screenTextPos.y})`,
}[schNetLabel.anchor_side]

// Add the label text
Expand Down
Loading

0 comments on commit 1ff83b8

Please sign in to comment.