diff --git a/pygame_gui/elements/ui_form.py b/pygame_gui/elements/ui_form.py index fc1cf3a6..e5468cd3 100644 --- a/pygame_gui/elements/ui_form.py +++ b/pygame_gui/elements/ui_form.py @@ -440,7 +440,8 @@ def __init__(self, parent_element=parent_element, object_id=object_id, anchors=anchors, - visible=visible) + visible=visible, + should_grow_automatically=True) self._create_valid_ids(container=container, parent_element=parent_element, diff --git a/pygame_gui/elements/ui_horizontal_scroll_bar.py b/pygame_gui/elements/ui_horizontal_scroll_bar.py index 4b4ea68e..35ef557c 100644 --- a/pygame_gui/elements/ui_horizontal_scroll_bar.py +++ b/pygame_gui/elements/ui_horizontal_scroll_bar.py @@ -436,7 +436,7 @@ def set_visible_percentage(self, percentage: float): """ self.visible_percentage = max(0.0, min(1.0, percentage)) - if 1.0 - self.start_percentage != self.visible_percentage: + if 1.0 - self.start_percentage < self.visible_percentage: self.start_percentage = 1.0 - self.visible_percentage self.redraw_scrollbar() diff --git a/pygame_gui/elements/ui_scrolling_container.py b/pygame_gui/elements/ui_scrolling_container.py index 8df67613..bcbaa8c7 100644 --- a/pygame_gui/elements/ui_scrolling_container.py +++ b/pygame_gui/elements/ui_scrolling_container.py @@ -49,7 +49,7 @@ def __init__(self, element_id: Union[List[str], None] = None, anchors: Optional[Dict[str, Union[str, UIElement]]] = None, visible: int = 1, - should_grow_automatically: bool = True, + should_grow_automatically: bool = False, allow_scroll_x: bool = True, allow_scroll_y: bool = True, ): diff --git a/pygame_gui/elements/ui_vertical_scroll_bar.py b/pygame_gui/elements/ui_vertical_scroll_bar.py index f76bb570..8289fef8 100644 --- a/pygame_gui/elements/ui_vertical_scroll_bar.py +++ b/pygame_gui/elements/ui_vertical_scroll_bar.py @@ -432,7 +432,7 @@ def set_visible_percentage(self, percentage: float): """ self.visible_percentage = max(0.0, min(1.0, percentage)) - if 1.0 - self.start_percentage != self.visible_percentage: + if 1.0 - self.start_percentage < self.visible_percentage: self.start_percentage = 1.0 - self.visible_percentage self.redraw_scrollbar() diff --git a/tests/test_elements/test_ui_scrolling_container.py b/tests/test_elements/test_ui_scrolling_container.py index b882243f..5c0bf3dd 100644 --- a/tests/test_elements/test_ui_scrolling_container.py +++ b/tests/test_elements/test_ui_scrolling_container.py @@ -384,7 +384,8 @@ def test_show_hide_rendering(self, _init_pygame, default_ui_manager, _display_su container = UIScrollingContainer(relative_rect=pygame.Rect(100, 100, 200, 100), manager=manager, - visible=0) + visible=0, + should_grow_automatically=True) button_1 = UIButton(relative_rect=pygame.Rect(300, 100, 150, 30), text="Test Button", tool_tip_text="This is a test of the button's tool tip functionality.",