Commit cd3855f3 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Allow adding rectangles with negative sizes to paths.

parent 29ec595e
...@@ -1507,7 +1507,7 @@ GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y, ...@@ -1507,7 +1507,7 @@ GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y,
TRACE("(%p, %.2f, %.2f, %.2f, %.2f)\n", path, x, y, width, height); TRACE("(%p, %.2f, %.2f, %.2f, %.2f)\n", path, x, y, width, height);
if(!path || width < 0.0 || height < 0.0) if(!path)
return InvalidParameter; return InvalidParameter;
/* make a backup copy of path data */ /* make a backup copy of path data */
......
...@@ -1106,6 +1106,34 @@ static void test_isvisible(void) ...@@ -1106,6 +1106,34 @@ static void test_isvisible(void)
ReleaseDC(0, hdc); ReleaseDC(0, hdc);
} }
static void test_empty_rect(void)
{
GpPath *path;
GpStatus status;
BOOL result;
status = GdipCreatePath(FillModeAlternate, &path);
expect(Ok, status);
status = GdipAddPathRectangle(path, 0.0, 0.0, -5.0, 5.0);
expect(Ok, status);
status = GdipIsVisiblePathPoint(path, -2.0, 2.0, NULL, &result);
expect(Ok, status);
expect(FALSE, status);
status = GdipAddPathRectangle(path, 0.0, 0.0, 5.0, -5.0);
expect(Ok, status);
status = GdipAddPathRectangle(path, 0.0, 0.0, 0.0, 5.0);
expect(Ok, status);
status = GdipAddPathRectangle(path, 0.0, 0.0, 5.0, 0.0);
expect(Ok, status);
GdipDeletePath(path);
}
START_TEST(graphicspath) START_TEST(graphicspath)
{ {
struct GdiplusStartupInput gdiplusStartupInput; struct GdiplusStartupInput gdiplusStartupInput;
...@@ -1135,6 +1163,7 @@ START_TEST(graphicspath) ...@@ -1135,6 +1163,7 @@ START_TEST(graphicspath)
test_addpie(); test_addpie();
test_flatten(); test_flatten();
test_isvisible(); test_isvisible();
test_empty_rect();
GdiplusShutdown(gdiplusToken); GdiplusShutdown(gdiplusToken);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment