Invalidate the focused item when scrolling horizontally so that it

repaints correctly.
This commit is contained in:
Huw Davies 2004-03-18 04:00:08 +00:00 committed by Alexandre Julliard
parent 00c5250a84
commit 66c1accb6f
1 changed files with 6 additions and 0 deletions

View File

@ -1210,8 +1210,14 @@ static void LISTBOX_SetHorizontalPos( HWND hwnd, LB_DESCR *descr, INT pos )
descr->horz_pos = pos;
LISTBOX_UpdateScroll( hwnd, descr );
if (abs(diff) < descr->width)
{
RECT rect;
/* Invalidate the focused item so it will be repainted correctly */
if (LISTBOX_GetItemRect( descr, descr->focus_item, &rect ) == 1)
InvalidateRect( hwnd, &rect, TRUE );
ScrollWindowEx( hwnd, diff, 0, NULL, NULL, 0, NULL,
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
}
else
InvalidateRect( hwnd, NULL, TRUE );
}