Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve flexibility of skin layout editor player avatar #29930

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions osu.Game/Screens/Play/HUD/PlayerAvatar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,23 @@ public partial class PlayerAvatar : CompositeDrawable, ISerialisableDrawable

private IBindable<APIUser>? apiUser;

private readonly Container cornerContainer;

public PlayerAvatar()
{
Size = new Vector2(default_size);

InternalChild = avatar = new UpdateableAvatar(isInteractive: false)
InternalChild = cornerContainer = new Container
{
Masking = true,
RelativeSizeAxes = Axes.Both,
Masking = true
Child = avatar = new UpdateableAvatar(isInteractive: false)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fill,
}
};
}

Expand All @@ -66,7 +75,7 @@ protected override void LoadComplete()
{
base.LoadComplete();

CornerRadius.BindValueChanged(e => avatar.CornerRadius = e.NewValue * default_size, true);
CornerRadius.BindValueChanged(e => cornerContainer.CornerRadius = e.NewValue * default_size, true);
}

public bool UsesFixedAnchor { get; set; }
Expand Down
Loading