Skip to content

Commit

Permalink
Fixing hyperlinks after mousewheel
Browse files Browse the repository at this point in the history
fixes #614
  • Loading branch information
MyreMylar committed Nov 10, 2024
1 parent 24c819e commit 19059d7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pygame_gui/elements/ui_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pygame_gui/elements/ui_horizontal_scroll_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
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 @@ -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,
):
Expand Down
2 changes: 1 addition & 1 deletion pygame_gui/elements/ui_vertical_scroll_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion tests/test_elements/test_ui_scrolling_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down

0 comments on commit 19059d7

Please sign in to comment.