mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +08:00
Allow bypassing origin/anchor setting of skinnable components
It makes little sense to set these when using RelativeSizeAxes.Both
This commit is contained in:
parent
899bac6ca5
commit
6a6718ebab
@ -14,6 +14,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
public SkinnableComboCounter()
|
||||
: base(new HUDSkinComponent(HUDSkinComponents.ComboCounter), createDefault)
|
||||
{
|
||||
CentreComponent = false;
|
||||
}
|
||||
|
||||
private IComboCounter skinnedCounter;
|
||||
|
@ -19,6 +19,12 @@ namespace osu.Game.Skinning
|
||||
/// </summary>
|
||||
public Drawable Drawable { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the drawable component should be centered in available space.
|
||||
/// Defaults to true.
|
||||
/// </summary>
|
||||
public bool CentreComponent { get; set; } = true;
|
||||
|
||||
public new Axes AutoSizeAxes
|
||||
{
|
||||
get => base.AutoSizeAxes;
|
||||
@ -84,8 +90,13 @@ namespace osu.Game.Skinning
|
||||
if (Drawable != null)
|
||||
{
|
||||
scaling.Invalidate();
|
||||
Drawable.Origin = Anchor.Centre;
|
||||
Drawable.Anchor = Anchor.Centre;
|
||||
|
||||
if (CentreComponent)
|
||||
{
|
||||
Drawable.Origin = Anchor.Centre;
|
||||
Drawable.Anchor = Anchor.Centre;
|
||||
}
|
||||
|
||||
InternalChild = Drawable;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user