ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.06k stars 2.23k forks source link

Context menus get cut off when in screen scaling mode #17436

Open stanriders opened 2 years ago

stanriders commented 2 years ago

Type

Cosmetic

Bug description

Using "Everything" screen scaling cuts off context menus at the edges of the screen instead of either letting them draw outside of scaled portion of moving them as it does when the menu appears near the edge of an actual screen.

Easiest way to replicate for me is to set screen scaling to "Everything", open skin editor and try right clicking on an element at the bottom edge of the scaled portion. Origin/Anchor submenus will be cut off

Screenshots or videos

image

Version

2022.319.0

Logs

Are not necessary

bdach commented 2 years ago

Definitely an issue, and this is going to require some kind of support on the framework side, but I'm not sure what that "something" would be.

When I was implementing nested menu clamping, I made a simplification that the containing input manager was going to be usable as the drawable to clamp menus against. This is not the case with game-side screen scaling active - the containing input manager encompasses the whole screen, while the "user active" area is the smaller, scaled, masked sub-rectangle of that.

The most obvious solution would be to provide some sort of marker interface or container (MenuContainer? IContainsMenu?), and use that first (if present) before falling back to GetContainingInputManager(). Trying to base this on masking somehow seems like a doomed attempt, as there may be many containers with masking active.