Add xmldoc, make restrictSize private

This commit is contained in:
Dean Herbert 2018-03-12 11:02:02 +09:00
parent d27cf16bf9
commit 1447ca55a3

View File

@ -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;