Add better fix for 1px bleed

This commit is contained in:
smoogipoo
2020-05-16 18:28:15 +09:00
parent 16cde20db4
commit 8c5ccf574b

View File

@ -52,12 +52,6 @@ namespace osu.Game.Screens.Ranking.Contracted
{ {
new Container new Container
{ {
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
new Container
{
Name = "Background",
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Masking = true, Masking = true,
CornerExponent = 2.5f, CornerExponent = 2.5f,
@ -70,6 +64,12 @@ namespace osu.Game.Screens.Ranking.Contracted
Offset = new Vector2(0, 4) Offset = new Vector2(0, 4)
}, },
Children = new Drawable[] Children = new Drawable[]
{
// Buffered container is used to prevent 1px bleed outside the masking region
new BufferedContainer
{
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{ {
new Box new Box
{ {
@ -81,32 +81,13 @@ namespace osu.Game.Screens.Ranking.Contracted
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
User = score.User, User = score.User,
}, },
} new Box
},
new Container
{
Name = "Background overlay",
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Bottom = -1 },
Child = new Container
{
RelativeSizeAxes = Axes.Both,
Masking = true,
CornerExponent = 2.5f,
CornerRadius = 20,
Child = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.5f), Color4Extensions.FromHex("#444")) Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.5f), Color4Extensions.FromHex("#444"))
} },
} }
}, },
new Container
{
Name = "Foreground",
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
new FillFlowContainer new FillFlowContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -172,8 +153,6 @@ namespace osu.Game.Screens.Ranking.Contracted
} }
} }
} }
}
}
}, },
}, },
new Drawable[] new Drawable[]