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 3b70cc3 commit 24c819e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
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
4 changes: 3 additions & 1 deletion pygame_gui/elements/ui_text_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ def __init__(self,
self.copy_text_enabled = True
self.paste_text_enabled = False

self.has_edit_cursor = False

self.rebuild_from_changed_theme_data()

@property
Expand Down Expand Up @@ -461,7 +463,7 @@ def update(self, time_delta: float):
self.edit_position = self.select_range[1]
self.cursor_has_moved_recently = True

if self.cursor_has_moved_recently:
if self.cursor_has_moved_recently and self.has_edit_cursor:
self.cursor_has_moved_recently = False

self.text_box_layout.set_cursor_position(self.edit_position)
Expand Down
1 change: 1 addition & 0 deletions pygame_gui/elements/ui_text_entry_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def __init__(self,
self.text_box_rows = 0

self.cursor_on = False
self.has_edit_cursor = True

self.should_redraw_from_text_block = False

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

0 comments on commit 24c819e

Please sign in to comment.