mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 02:03:04 +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()
|
public SkinnableComboCounter()
|
||||||
: base(new HUDSkinComponent(HUDSkinComponents.ComboCounter), createDefault)
|
: base(new HUDSkinComponent(HUDSkinComponents.ComboCounter), createDefault)
|
||||||
{
|
{
|
||||||
|
CentreComponent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IComboCounter skinnedCounter;
|
private IComboCounter skinnedCounter;
|
||||||
|
@ -19,6 +19,12 @@ namespace osu.Game.Skinning
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Drawable Drawable { get; private set; }
|
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
|
public new Axes AutoSizeAxes
|
||||||
{
|
{
|
||||||
get => base.AutoSizeAxes;
|
get => base.AutoSizeAxes;
|
||||||
@ -84,8 +90,13 @@ namespace osu.Game.Skinning
|
|||||||
if (Drawable != null)
|
if (Drawable != null)
|
||||||
{
|
{
|
||||||
scaling.Invalidate();
|
scaling.Invalidate();
|
||||||
Drawable.Origin = Anchor.Centre;
|
|
||||||
Drawable.Anchor = Anchor.Centre;
|
if (CentreComponent)
|
||||||
|
{
|
||||||
|
Drawable.Origin = Anchor.Centre;
|
||||||
|
Drawable.Anchor = Anchor.Centre;
|
||||||
|
}
|
||||||
|
|
||||||
InternalChild = Drawable;
|
InternalChild = Drawable;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user