Use the item box rather than the bounds when invalidating.

Implement 'bPartial' in EnsureVisible.
This commit is contained in:
Dimitrie O. Paun 2002-10-11 23:33:25 +00:00 committed by Alexandre Julliard
parent 78a9bf8709
commit a1ca0122b9
1 changed files with 6 additions and 7 deletions

View File

@ -866,10 +866,9 @@ static inline LRESULT CallWindowProcT(WNDPROC proc, HWND hwnd, UINT uMsg,
}
#define LISTVIEW_InvalidateItem(infoPtr, nItem) do { \
RECT rcItem; \
rcItem.left = LVIR_BOUNDS; \
if(LISTVIEW_GetItemRect(infoPtr, nItem, &rcItem)) \
LISTVIEW_InvalidateRect(infoPtr, &rcItem); \
RECT rcBox; \
if(LISTVIEW_GetItemBox(infoPtr, nItem, &rcBox)) \
LISTVIEW_InvalidateRect(infoPtr, &rcBox); \
} while (0)
#define LISTVIEW_InvalidateList(infoPtr)\
@ -4102,13 +4101,13 @@ static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *infoPtr, INT nItem, BOOL bPart
INT nVertAdjust = 0;
INT nHorzDiff = 0;
INT nVertDiff = 0;
RECT rcItem;
/* FIXME: ALWAYS bPartial == FALSE, FOR NOW! */
RECT rcItem, rcTemp;
rcItem.left = LVIR_BOUNDS;
if (!LISTVIEW_GetItemRect(infoPtr, nItem, &rcItem)) return FALSE;
if (bPartial && IntersectRect(&rcTemp, &infoPtr->rcList, &rcItem)) return TRUE;
if (rcItem.left < infoPtr->rcList.left || rcItem.right > infoPtr->rcList.right)
{
/* scroll left/right, but in LVS_REPORT mode */