mirror of
https://github.com/ppy/osu
synced 2025-02-27 16:11:43 +00:00
Merge pull request #24099 from bdach/fix-oob-selection-box-again
Fix edge cases where selection buttons go outside playfield bounds
This commit is contained in:
commit
b3c874fdc5
@ -377,10 +377,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
float leftExcess = thisQuad.TopLeft.X - parentQuad.TopLeft.X;
|
float leftExcess = thisQuad.TopLeft.X - parentQuad.TopLeft.X;
|
||||||
float rightExcess = parentQuad.TopRight.X - thisQuad.TopRight.X;
|
float rightExcess = parentQuad.TopRight.X - thisQuad.TopRight.X;
|
||||||
|
|
||||||
if (topExcess + bottomExcess < buttons.Height + button_padding)
|
float minHeight = buttons.ScreenSpaceDrawQuad.Height;
|
||||||
|
|
||||||
|
if (topExcess < minHeight && bottomExcess < minHeight)
|
||||||
{
|
{
|
||||||
buttons.Anchor = Anchor.BottomCentre;
|
buttons.Anchor = Anchor.BottomCentre;
|
||||||
buttons.Origin = Anchor.BottomCentre;
|
buttons.Origin = Anchor.BottomCentre;
|
||||||
|
buttons.Y = Math.Min(0, ToLocalSpace(Parent.ScreenSpaceDrawQuad.BottomLeft).Y - DrawHeight);
|
||||||
}
|
}
|
||||||
else if (topExcess > bottomExcess)
|
else if (topExcess > bottomExcess)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user