diff --git a/UiaComWrapper/InternalSchema.cs b/UiaComWrapper/InternalSchema.cs index 5b05f3f..274b133 100644 --- a/UiaComWrapper/InternalSchema.cs +++ b/UiaComWrapper/InternalSchema.cs @@ -273,7 +273,15 @@ private static object ConvertToRect(object value) double x = numArray[0]; double y = numArray[1]; double width = numArray[2]; - return new Rect(x, y, width, numArray[3]); + double height = numArray[3]; + + if (width < 0) + width = 0; + + if (height < 0) + height = 0; + + return new Rect(x, y, width, height); } private static object ConvertToRowOrColumnMajor(object value)