1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-17 17:17:19 +08:00

Merge pull request #5956 from Joehuu/center-icon-and-text-correctly

Center icon and text using anchor and origin instead of margin
This commit is contained in:
Dan Balasescu 2019-09-03 15:30:12 +09:00 committed by GitHub
commit 953ea83cb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -121,10 +121,11 @@ namespace osu.Game.Overlays.Chat.Selection
{
new SpriteIcon
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Icon = FontAwesome.Solid.User,
Size = new Vector2(text_size - 2),
Shadow = false,
Margin = new MarginPadding { Top = 1 },
},
new OsuSpriteText
{

View File

@ -190,10 +190,11 @@ namespace osu.Game.Overlays.Direct
text = new OsuSpriteText { Font = OsuFont.GetFont(weight: FontWeight.SemiBold, italics: true) },
new SpriteIcon
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Icon = icon,
Shadow = true,
Size = new Vector2(14),
Margin = new MarginPadding { Top = 1 },
},
};

View File

@ -161,12 +161,12 @@ namespace osu.Game.Overlays.Music
{
public PlaylistItemHandle()
{
Anchor = Anchor.TopLeft;
Origin = Anchor.TopLeft;
Anchor = Anchor.CentreLeft;
Origin = Anchor.CentreLeft;
Size = new Vector2(12);
Icon = FontAwesome.Solid.Bars;
Alpha = 0f;
Margin = new MarginPadding { Left = 5, Top = 2 };
Margin = new MarginPadding { Left = 5 };
}
public override bool HandlePositionalInput => IsPresent;