mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 14:37:30 +08:00
Merge pull request #30535 from bdach/fix-hud-shifting-when-flipped-drawables-present
Fix HUD elements shifting in unintended manner when partially off-screen flipped skin elements are present
This commit is contained in:
commit
8bd65d9938
@ -300,7 +300,9 @@ namespace osu.Game.Screens.Play
|
|||||||
if (element is LegacyHealthDisplay)
|
if (element is LegacyHealthDisplay)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float bottom = drawable.ScreenSpaceDrawQuad.BottomRight.Y;
|
// AABB is used here because the drawable can be flipped/rotated arbitrarily,
|
||||||
|
// so the "bottom right" corner of the raw SSDQ might not necessarily be where one expects it to be.
|
||||||
|
float bottom = drawable.ScreenSpaceDrawQuad.AABBFloat.BottomRight.Y;
|
||||||
|
|
||||||
bool isRelativeX = drawable.RelativeSizeAxes == Axes.X;
|
bool isRelativeX = drawable.RelativeSizeAxes == Axes.X;
|
||||||
|
|
||||||
@ -319,7 +321,7 @@ namespace osu.Game.Screens.Play
|
|||||||
// and align bottom-right components with the top-edge of the highest bottom-anchored hud element.
|
// and align bottom-right components with the top-edge of the highest bottom-anchored hud element.
|
||||||
else if (drawable.Anchor.HasFlag(Anchor.BottomRight) || (drawable.Anchor.HasFlag(Anchor.y2) && drawable.RelativeSizeAxes == Axes.X))
|
else if (drawable.Anchor.HasFlag(Anchor.BottomRight) || (drawable.Anchor.HasFlag(Anchor.y2) && drawable.RelativeSizeAxes == Axes.X))
|
||||||
{
|
{
|
||||||
var topLeft = element.ScreenSpaceDrawQuad.TopLeft;
|
var topLeft = element.ScreenSpaceDrawQuad.AABBFloat.TopLeft;
|
||||||
if (highestBottomScreenSpace == null || topLeft.Y < highestBottomScreenSpace.Value.Y)
|
if (highestBottomScreenSpace == null || topLeft.Y < highestBottomScreenSpace.Value.Y)
|
||||||
highestBottomScreenSpace = topLeft;
|
highestBottomScreenSpace = topLeft;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user