Skip to content

Commit

Permalink
Fixed position set to [0,0] bug (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: ericx <[email protected]>
  • Loading branch information
EricXie-02 and ericx authored May 22, 2024
1 parent 4eec890 commit e7dde6e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions parchmint/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(
Raises:
Exception: [description]
"""

self.name: str = name
self.ID: str = ID
self.params = params
Expand All @@ -45,8 +46,8 @@ def __init__(
self.yspan: int = yspan
self._ports: List[Port] = ports_list if ports_list else []
self.layers: List[Layer] = layers if layers else []
self.xpos = xpos
self.ypos = ypos
self.xpos = params.data["position"][0]
self.ypos = params.data["position"][1]

@property
def ports(self) -> List[Port]:
Expand Down Expand Up @@ -98,7 +99,9 @@ def xpos(self, value) -> None:
Args:
value (int): x coordianate of the object
"""

if self.params.exists("position"):

pos = self.params.get_param("position")
pos[0] = value
self.params.set_param("position", pos)
Expand Down

0 comments on commit e7dde6e

Please sign in to comment.