From 8e03d121ac1357d94e9ece9fcd2e06d9b175c264 Mon Sep 17 00:00:00 2001 From: GMIKE Date: Tue, 1 Sep 2020 14:10:20 +0300 Subject: [PATCH] Deconstruct and IsEmpty propterty --- src/Avalonia.Visuals/Point.cs | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/Avalonia.Visuals/Point.cs b/src/Avalonia.Visuals/Point.cs index f9ae1f2fe1..2e77f5528b 100644 --- a/src/Avalonia.Visuals/Point.cs +++ b/src/Avalonia.Visuals/Point.cs @@ -357,30 +357,22 @@ namespace Avalonia } /// - /// Returns a new point with the opposite coordinates. + /// Deconstructor for decomposition Point /// - /// The new point. - public Point Miror() - { - return new Point(-_x, -_y); - } - - /// - /// Returns a new point with the opposite X coordinate. - /// - /// The new point. - public Point WithMirorX() + /// The X position. + /// The Y position. + public void Deconstruct(out double x, out double y) { - return new Point(-_x, _y); + x = this._x; + y = this._y; } /// - /// Returns a new point with the opposite Y coordinate. + /// Gets a value indicating that Point coordinatrs is zero /// - /// The new point. - public Point WithMirorY() + public bool IsEmpty { - return new Point(_x, -_y); + get { return (_x == 0) && (_y == 0); } } } }