Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu State rect now uses menu frame rect instead of contents rect. #2886

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

hats-np
Copy link
Contributor

@hats-np hats-np commented Apr 8, 2023

When a menu is opened near the edge of screen, the rect of the add_contents response is always > cursor_pos as expected during regular function, but not when the area moves itself to accommodate the screen edges.

As a solution I made the menu_state rect be the same as the menu frame, which fixes the issue. I am unsure if there is a better solution, such as making the add_contents aware that their parent has been moved.

I also removed a redundant call that set the menu_state rect a second time unnecessarily as it had already been set during MenuState::show.

Closes #2862 .

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@emilk emilk merged commit 77df9cb into emilk:master Apr 18, 2023
@emilk emilk added bug Something is broken egui labels Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken egui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Menu buttons do not work near the edge of screen
2 participants