Browse Source

Merge branch 'master' into render-inside-win-ui-comp-tree

win-ui-comp-with-manual-fbo
danwalmsley 5 years ago
committed by GitHub
parent
commit
463ec8382b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      src/Avalonia.Visuals/Point.cs
  2. 19
      src/Avalonia.Visuals/Size.cs
  3. 23
      src/Avalonia.Visuals/Thickness.cs
  4. 19
      src/Avalonia.Visuals/Vector.cs

19
src/Avalonia.Visuals/Point.cs

@ -267,5 +267,24 @@ namespace Avalonia
{
return new Point(_x, y);
}
/// <summary>
/// Deconstructs the point into its X and Y coordinates.
/// </summary>
/// <param name="x">The X coordinate.</param>
/// <param name="y">The Y coordinate.</param>
public void Deconstruct(out double x, out double y)
{
x = this._x;
y = this._y;
}
/// <summary>
/// Gets a value indicating whether the X and Y coordinates are zero.
/// </summary>
public bool IsDefault
{
get { return (_x == 0) && (_y == 0); }
}
}
}

19
src/Avalonia.Visuals/Size.cs

@ -276,5 +276,24 @@ namespace Avalonia
{
return string.Format(CultureInfo.InvariantCulture, "{0}, {1}", _width, _height);
}
/// <summary>
/// Deconstructs the size into its Width and Height values.
/// </summary>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
public void Deconstruct(out double width, out double height)
{
width = this._width;
height = this._height;
}
/// <summary>
/// Gets a value indicating whether the Width and Height values are zero.
/// </summary>
public bool IsDefault
{
get { return (_width == 0) && (_height == 0); }
}
}
}

23
src/Avalonia.Visuals/Thickness.cs

@ -272,5 +272,28 @@ namespace Avalonia
{
return $"{_left},{_top},{_right},{_bottom}";
}
/// <summary>
/// Deconstructor the thickness into its left, top, right and bottom thickness values.
/// </summary>
/// <param name="left">The thickness on the left.</param>
/// <param name="top">The thickness on the top.</param>
/// <param name="right">The thickness on the right.</param>
/// <param name="bottom">The thickness on the bottom.</param>
public void Deconstruct(out double left, out double top, out double right, out double bottom)
{
left = this._left;
top = this._top;
right = this._right;
bottom = this._bottom;
}
/// <summary>
/// Gets a value indicating whether the left, top, right and bottom thickness values are zero.
/// </summary>
public bool IsDefault
{
get { return (_left == 0) && (_top == 0) && (_right == 0) && (_bottom == 0); }
}
}
}

19
src/Avalonia.Visuals/Vector.cs

@ -333,5 +333,24 @@ namespace Avalonia
/// </summary>
public static Vector UnitY
=> new Vector(0, 1);
/// <summary>
/// Deconstructs the vector into its X and Y components.
/// </summary>
/// <param name="x">The X component.</param>
/// <param name="y">The Y component.</param>
public void Deconstruct(out double x, out double y)
{
x = this._x;
y = this._y;
}
/// <summary>
/// Gets a value indicating whether the X and Y components are zero.
/// </summary>
public bool IsDefault
{
get { return (_x == 0) && (_y == 0); }
}
}
}

Loading…
Cancel
Save