Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Controls/src/Core/Window/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void IWindow.FrameChanged(Rect frame)
var y = Y;
var width = Width;
var height = Height;
if (new Rect(x, y, width, height) == frame)
if (frame.X == x && frame.Y == y && frame.Width == width && frame.Height == height)
return;

_batchFrameUpdate++;
Expand Down
25 changes: 23 additions & 2 deletions src/Graphics/src/Graphics/Rect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,34 @@ namespace Microsoft.Maui.Graphics
[TypeConverter(typeof(Converters.RectTypeConverter))]
public partial struct Rect
{
double _height;
double _width;

public double X { get; set; }

public double Y { get; set; }

public double Width { get; set; }
public double Width
{
get => _width;
set
{
if (double.IsNaN(value))
throw new ArgumentOutOfRangeException(nameof(value), value, "Cannot be NaN");
_width = value;
}
}

public double Height { get; set; }
public double Height
{
get => _height;
set
{
if (double.IsNaN(value))
throw new ArgumentOutOfRangeException(nameof(value), value, "Cannot be NaN");
_height = value;
}
}

public static Rect Zero = new Rect();

Expand Down