1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-24 04:49:54 +08:00

Merge pull request #31969 from bdach/flag-display-adjustment

Adjust handling of team flags with non-matching aspect ratio to match web
This commit is contained in:
Dean Herbert
2025-02-20 23:55:53 +09:00
committed by GitHub
Unverified
2 changed files with 24 additions and 6 deletions
@@ -6,6 +6,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Tournament.Models;
@@ -35,12 +36,20 @@ namespace osu.Game.Tournament.Components
Size = new Vector2(75, 54);
Masking = true;
CornerRadius = 5;
Child = flagSprite = new Sprite
Children = new Drawable[]
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fill
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Colour4.FromHex("333"),
},
flagSprite = new Sprite
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fit
},
};
(flag = team.FlagName.GetBoundCopy()).BindValueChanged(_ => flagSprite.Texture = textures.Get($@"Flags/{team.FlagName}"), true);
+10 -1
View File
@@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Localisation;
@@ -75,10 +76,18 @@ namespace osu.Game.Users.Drawables
InternalChildren = new Drawable[]
{
new HoverClickSounds(),
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Colour4.FromHex("333"),
},
new Sprite
{
RelativeSizeAxes = Axes.Both,
Texture = textures.Get(team.FlagUrl)
Texture = textures.Get(team.FlagUrl),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fit,
}
};
}