Commit 5215895a authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Support wrongly ordered rectangles in RectVisible.

parent 456b4c87
......@@ -392,6 +392,7 @@ BOOL WINAPI RectVisible( HDC hdc, const RECT* rect )
tmpRect = *rect;
LPtoDP( hdc, (POINT *)&tmpRect, 2 );
order_rect( &tmpRect );
update_dc( dc );
ret = (!get_dc_device_rect( dc, &visrect ) || intersect_rect( &visrect, &visrect, &tmpRect ));
......
......@@ -401,6 +401,14 @@ static void test_memory_dc_clipping(void)
ok(rc.left == 0 && rc.top == 0 && rc.right == 100 && rc.bottom == 100,
"expected 0,0-100,100, got %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom);
SetRect( &rc, 10, 10, 20, 20 );
ret = RectVisible( hdc, &rc );
ok( ret, "RectVisible failed for %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom );
SetRect( &rc, 20, 20, 10, 10 );
ret = RectVisible( hdc, &rc );
ok( ret, "RectVisible failed for %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom );
DeleteDC(hdc);
DeleteObject(hrgn);
DeleteObject(hrgn_empty);
......@@ -446,6 +454,14 @@ static void test_window_dc_clipping(void)
"expected 0,0-%d,%d, got %d,%d-%d,%d\n", screen_width, screen_height,
rc.left, rc.top, rc.right, rc.bottom);
SetRect( &rc, 10, 10, 20, 20 );
ret = RectVisible( hdc, &rc );
ok( ret, "RectVisible failed for %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom );
SetRect( &rc, 20, 20, 10, 10 );
ret = RectVisible( hdc, &rc );
ok( ret, "RectVisible failed for %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom );
ret = ExtSelectClipRgn(hdc, 0, RGN_COPY);
ok(ret == SIMPLEREGION || (ret == COMPLEXREGION && GetSystemMetrics(SM_CMONITORS) > 1),
"expected SIMPLEREGION, got %d\n", ret);
......
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