-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from tscircuit/fix/shifting-port-position
Adding the missing trace space between the ports and route
- Loading branch information
Showing
7 changed files
with
95 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const projectPointInOppositeDirection = ( | ||
point: { x: number; y: number }, | ||
direction: "up" | "down" | "left" | "right", | ||
distance: number, | ||
) => { | ||
switch (direction) { | ||
case "up": | ||
return { x: point.x, y: point.y + distance } | ||
case "down": | ||
return { x: point.x, y: point.y - distance } | ||
case "left": | ||
return { x: point.x + distance, y: point.y } | ||
case "right": | ||
return { x: point.x - distance, y: point.y } | ||
default: | ||
throw new Error(`Unknown direction "${direction}"`) | ||
} | ||
} |
Oops, something went wrong.