mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Center icon and text using anchor and origin instead of margin
This commit is contained in:
parent
3443a9517f
commit
6ca17bdfd5
@ -121,10 +121,11 @@ namespace osu.Game.Overlays.Chat.Selection
|
|||||||
{
|
{
|
||||||
new SpriteIcon
|
new SpriteIcon
|
||||||
{
|
{
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
Icon = FontAwesome.Solid.User,
|
Icon = FontAwesome.Solid.User,
|
||||||
Size = new Vector2(text_size - 2),
|
Size = new Vector2(text_size - 2),
|
||||||
Shadow = false,
|
Shadow = false,
|
||||||
Margin = new MarginPadding { Top = 1 },
|
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
@ -190,10 +190,11 @@ namespace osu.Game.Overlays.Direct
|
|||||||
text = new OsuSpriteText { Font = OsuFont.GetFont(weight: FontWeight.SemiBold, italics: true) },
|
text = new OsuSpriteText { Font = OsuFont.GetFont(weight: FontWeight.SemiBold, italics: true) },
|
||||||
new SpriteIcon
|
new SpriteIcon
|
||||||
{
|
{
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
Icon = icon,
|
Icon = icon,
|
||||||
Shadow = true,
|
Shadow = true,
|
||||||
Size = new Vector2(14),
|
Size = new Vector2(14),
|
||||||
Margin = new MarginPadding { Top = 1 },
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -161,12 +161,12 @@ namespace osu.Game.Overlays.Music
|
|||||||
{
|
{
|
||||||
public PlaylistItemHandle()
|
public PlaylistItemHandle()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopLeft;
|
Anchor = Anchor.CentreLeft;
|
||||||
Origin = Anchor.TopLeft;
|
Origin = Anchor.CentreLeft;
|
||||||
Size = new Vector2(12);
|
Size = new Vector2(12);
|
||||||
Icon = FontAwesome.Solid.Bars;
|
Icon = FontAwesome.Solid.Bars;
|
||||||
Alpha = 0f;
|
Alpha = 0f;
|
||||||
Margin = new MarginPadding { Left = 5, Top = 2 };
|
Margin = new MarginPadding { Left = 5 };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandlePositionalInput => IsPresent;
|
public override bool HandlePositionalInput => IsPresent;
|
||||||
|
Loading…
Reference in New Issue
Block a user