mirror of
https://github.com/ppy/osu
synced 2025-03-01 00:51:39 +00:00
Add xmldoc, make restrictSize private
This commit is contained in:
parent
d27cf16bf9
commit
1447ca55a3
@ -22,16 +22,20 @@ namespace osu.Game.Skinning
|
||||
|
||||
private readonly string componentName;
|
||||
|
||||
/// <summary>
|
||||
/// Whether a user-skin drawable should be limited to the size of our parent.
|
||||
/// </summary>
|
||||
public readonly bool RestrictSize;
|
||||
private readonly bool restrictSize;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="name">The namespace-complete resource name for this skinnable element.</param>
|
||||
/// <param name="defaultImplementation">A function to create the default skin implementation of this element.</param>
|
||||
/// <param name="fallback">Whther to fallback to the default implementation when a custom skin is specified but not implementation is present.</param>
|
||||
/// <param name="restrictSize">Whether a user-skin drawable should be limited to the size of our parent.</param>
|
||||
public SkinnableDrawable(string name, Func<string, T> defaultImplementation, bool fallback = true, bool restrictSize = true) : base(fallback)
|
||||
{
|
||||
componentName = name;
|
||||
createDefault = defaultImplementation;
|
||||
RestrictSize = restrictSize;
|
||||
this.restrictSize = restrictSize;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
@ -41,7 +45,7 @@ namespace osu.Game.Skinning
|
||||
var drawable = skin.GetDrawableComponent(componentName);
|
||||
if (drawable != null)
|
||||
{
|
||||
if (RestrictSize)
|
||||
if (restrictSize)
|
||||
{
|
||||
drawable.RelativeSizeAxes = Axes.Both;
|
||||
drawable.Size = Vector2.One;
|
||||
|
Loading…
Reference in New Issue
Block a user