user32: Don't bother drawing an item if it's outside the items_rect.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-03-31 09:52:40 +01:00 committed by Alexandre Julliard
parent 21c5545a97
commit 962d5e6469
1 changed files with 6 additions and 4 deletions

View File

@ -1417,6 +1417,12 @@ static void MENU_DrawMenuItem( HWND hwnd, POPUPMENU *menu, HWND hwndOwner, HDC h
return;
}
TRACE( "rect=%s\n", wine_dbgstr_rect( &lpitem->rect ) );
rect = lpitem->rect;
MENU_AdjustMenuItemRect( menu, &rect );
if (!IntersectRect( &bmprc, &rect, &menu->items_rect )) /* bmprc is used as a dummy */
return;
SystemParametersInfoW (SPI_GETFLATMENU, 0, &flat_menu, 0);
bkgnd = (menuBar && flat_menu) ? COLOR_MENUBAR : COLOR_MENU;
@ -1444,10 +1450,6 @@ static void MENU_DrawMenuItem( HWND hwnd, POPUPMENU *menu, HWND hwndOwner, HDC h
SetBkColor( hdc, GetSysColor( bkgnd ) );
}
TRACE("rect=%s\n", wine_dbgstr_rect( &lpitem->rect));
rect = lpitem->rect;
MENU_AdjustMenuItemRect(menu, &rect);
old_clip = CreateRectRgn( 0, 0, 0, 0 );
if (GetClipRgn( hdc, old_clip ) <= 0)
{