Commit 0485fc19 authored by Maxime Bellengé's avatar Maxime Bellengé Committed by Alexandre Julliard

Fix bounding rectangle computation for an ownerdraw tab.

parent dfdeaaf9
...@@ -1488,14 +1488,6 @@ TAB_DrawItemInterior ...@@ -1488,14 +1488,6 @@ TAB_DrawItemInterior
SetTextColor(hdc, (iItem == infoPtr->iHotTracked) ? SetTextColor(hdc, (iItem == infoPtr->iHotTracked) ?
comctl32_color.clrHighlight : comctl32_color.clrBtnText); comctl32_color.clrHighlight : comctl32_color.clrBtnText);
/*
* Deflate the rectangle to acount for the padding
*/
if(lStyle & TCS_VERTICAL)
InflateRect(drawRect, -infoPtr->uVItemPadding, -infoPtr->uHItemPadding);
else
InflateRect(drawRect, -infoPtr->uHItemPadding, -infoPtr->uVItemPadding);
/* /*
* if owner draw, tell the owner to draw * if owner draw, tell the owner to draw
...@@ -1517,13 +1509,14 @@ TAB_DrawItemInterior ...@@ -1517,13 +1509,14 @@ TAB_DrawItemInterior
dis.CtlID = id; dis.CtlID = id;
dis.itemID = iItem; dis.itemID = iItem;
dis.itemAction = ODA_DRAWENTIRE; dis.itemAction = ODA_DRAWENTIRE;
dis.itemState = 0;
if ( iItem == infoPtr->iSelected ) if ( iItem == infoPtr->iSelected )
dis.itemState = ODS_SELECTED; dis.itemState |= ODS_SELECTED;
else if (infoPtr->uFocus == iItem)
dis.itemState = 0; dis.itemState |= ODS_FOCUS;
dis.hwndItem = hwnd; /* */ dis.hwndItem = hwnd; /* */
dis.hDC = hdc; dis.hDC = hdc;
dis.rcItem = *drawRect; /* */ CopyRect(&dis.rcItem,drawRect);
dis.itemData = infoPtr->items[iItem].lParam; dis.itemData = infoPtr->items[iItem].lParam;
/* /*
...@@ -1550,6 +1543,14 @@ TAB_DrawItemInterior ...@@ -1550,6 +1543,14 @@ TAB_DrawItemInterior
RECT rcText; RECT rcText;
INT center_offset; INT center_offset;
/*
* Deflate the rectangle to acount for the padding
*/
if(lStyle & TCS_VERTICAL)
InflateRect(drawRect, -infoPtr->uVItemPadding, -infoPtr->uHItemPadding);
else
InflateRect(drawRect, -infoPtr->uHItemPadding, -infoPtr->uVItemPadding);
/* set rcImage to drawRect, we will use top & left in our ImageList_Draw call */ /* set rcImage to drawRect, we will use top & left in our ImageList_Draw call */
rcImage = *drawRect; rcImage = *drawRect;
......
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