Skip to content

Commit

Permalink
Merge pull request #482 from MyreMylar/fix-scrolling-container-set-pos
Browse files Browse the repository at this point in the history
Fix UIScrollingContainer .set_position()
  • Loading branch information
MyreMylar authored Nov 19, 2023
2 parents dccb0e5 + 16f119d commit 7a51ad4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pygame_gui/elements/ui_scrolling_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def set_position(self, position: Union[pygame.math.Vector2,
"""

super().set_position(position)
self._root_container.set_dimensions(position)
self._root_container.set_position(position)

def set_relative_position(self, position: Union[pygame.math.Vector2,
Tuple[int, int],
Expand Down
1 change: 1 addition & 0 deletions tests/test_elements/test_ui_scrolling_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def test_set_position(self, _init_pygame, default_ui_manager,
container.set_position((50, 50))

assert container.rect.topleft == (50, 50)
assert container._root_container.rect.size == (200, 200)

def test_set_relative_position(self, _init_pygame, default_ui_manager,
_display_surface_return_none):
Expand Down

0 comments on commit 7a51ad4

Please sign in to comment.