Open retsyx opened 2 months ago
It appears that it can be fixed with only this change:
pygame_gui/core/layered_gui_group.py
def update_visibility(self):
"""
Update the list of what is currently visible.
Called when we add or remove elements from the group or when an element is hidden or shown.
"""
self.visible = [spr.blit_data
- for spr in self._spritelist
+ for spr in self._spritelist
if spr.image is not None and spr.visible][::-1]
I've submitted a PR 🤞
@retsyx your test case made it super easy to reproduce and test this! Thank you!
Well, that's embarrassing. it turns out that my "fix" also changed the draw order. If I really want to submit a PR I should check more carefully 😅️.. going to close my PR for the moment.
Describe the bug
Given two overlapping elements, the bottom element gets precedence for mouse press events, when the topmost element should.
To Reproduce Steps to reproduce the behaviour:
Expected behaviour Drawing should be back to front (as it is). Event handling should be front to back.
Screenshots
N/A
Platform and software (please complete the following information):
Additional context
Code to reproduce the issue. Prints button click events to stdout.