Browse Source

Deconstruct and IsEmpty propterty

pull/4589/head
GMIKE 6 years ago
parent
commit
8e03d121ac
  1. 26
      src/Avalonia.Visuals/Point.cs

26
src/Avalonia.Visuals/Point.cs

@ -357,30 +357,22 @@ namespace Avalonia
}
/// <summary>
/// Returns a new point with the opposite coordinates.
/// Deconstructor for decomposition Point
/// </summary>
/// <returns>The new point.</returns>
public Point Miror()
{
return new Point(-_x, -_y);
}
/// <summary>
/// Returns a new point with the opposite X coordinate.
/// </summary>
/// <returns>The new point.</returns>
public Point WithMirorX()
/// <param name="x">The X position.</param>
/// <param name="y">The Y position.</param>
public void Deconstruct(out double x, out double y)
{
return new Point(-_x, _y);
x = this._x;
y = this._y;
}
/// <summary>
/// Returns a new point with the opposite Y coordinate.
/// Gets a value indicating that Point coordinatrs is zero
/// </summary>
/// <returns>The new point.</returns>
public Point WithMirorY()
public bool IsEmpty
{
return new Point(_x, -_y);
get { return (_x == 0) && (_y == 0); }
}
}
}

Loading…
Cancel
Save