Skip to content

Commit 507d1c3

Browse files
Makes AnchorPoint target_attribute "private"
1 parent 9d97d06 commit 507d1c3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/pyrite/types/enums.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class Anchor:
140140
"""
141141

142142
def __init__(self, target_attribute: str) -> None:
143-
self.target_attribute = target_attribute
143+
self._target_attribute = target_attribute
144144

145145
def anchor_rect(self, rectangle: RectLike, position: Point) -> pygame.Rect:
146146
"""
@@ -153,7 +153,7 @@ def anchor_rect(self, rectangle: RectLike, position: Point) -> pygame.Rect:
153153
:return: The new rectangle, in the position location.
154154
"""
155155
rect = pygame.Rect(rectangle)
156-
rect.__setattr__(self.target_attribute, position)
156+
rect.__setattr__(self._target_attribute, position)
157157
return rect
158158

159159
def anchor_rect_ip(self, rectangle: pygame.Rect, position: Point) -> None:
@@ -164,7 +164,7 @@ def anchor_rect_ip(self, rectangle: pygame.Rect, position: Point) -> None:
164164
:param rectangle: A rectangle that will have its position modified.
165165
:param position: A position to move the rectangle to.
166166
"""
167-
rectangle.__setattr__(self.target_attribute, position)
167+
rectangle.__setattr__(self._target_attribute, position)
168168

169169

170170
class CustomAnchor(Anchor):

0 commit comments

Comments
 (0)