mirror of https://github.com/ppy/osu
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 @@ void processDrawable(ISerialisableDrawable element)
|
|||
if (element is LegacyHealthDisplay)
|
||||
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;
|
||||
|
||||
|
@ -319,7 +321,7 @@ void processDrawable(ISerialisableDrawable 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))
|
||||
{
|
||||
var topLeft = element.ScreenSpaceDrawQuad.TopLeft;
|
||||
var topLeft = element.ScreenSpaceDrawQuad.AABBFloat.TopLeft;
|
||||
if (highestBottomScreenSpace == null || topLeft.Y < highestBottomScreenSpace.Value.Y)
|
||||
highestBottomScreenSpace = topLeft;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue