Commit 0766d375 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Mirror the returned rectangle in GetClipBox for RTL layout.

parent 72533173
......@@ -400,6 +400,12 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect )
DeleteObject( hrgn );
}
else ret = GetRgnBox( dc->hVisRgn, rect );
if (dc->layout & LAYOUT_RTL)
{
int tmp = rect->left;
rect->left = rect->right - 1;
rect->right = tmp - 1;
}
DPtoLP( hdc, (LPPOINT)rect, 2 );
release_dc_ptr( dc );
return ret;
......
......@@ -313,6 +313,9 @@ static void test_dc_layout(void)
GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
GetClipBox( hdc, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
SetRectRgn( hrgn, 60, 10, 80, 20 );
pSetLayout( hdc, LAYOUT_LTR );
ExtSelectClipRgn( hdc, hrgn, RGN_OR );
......@@ -322,6 +325,9 @@ static void test_dc_layout(void)
GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
GetClipBox( hdc, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
/* OffsetClipRgn mirrors too */
OffsetClipRgn( hdc, 5, 5 );
......
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