X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04857cb707be4de8083e599fc2e1967c77eb7f5e..1978421a6d8b81c1f8a961da4b8ddf544fec7b1b:/src/generic/renderg.cpp diff --git a/src/generic/renderg.cpp b/src/generic/renderg.cpp index 9f409c3e98..5f7f0074c3 100644 --- a/src/generic/renderg.cpp +++ b/src/generic/renderg.cpp @@ -209,18 +209,24 @@ wxRendererGeneric::DrawTreeItemButton(wxWindow * WXUNUSED(win), // white background dc.SetPen(*wxGREY_PEN); dc.SetBrush(*wxWHITE_BRUSH); - dc.DrawRectangle(rect.Deflate(1, 2)); + dc.DrawRectangle(rect); // black lines const wxCoord xMiddle = rect.x + rect.width/2; const wxCoord yMiddle = rect.y + rect.height/2; + // half of the length of the horz lines in "-" and "+" + const wxCoord halfWidth = rect.width/2 - 2; dc.SetPen(*wxBLACK_PEN); - dc.DrawLine(xMiddle - 2, yMiddle, xMiddle + 3, yMiddle); + dc.DrawLine(xMiddle - halfWidth, yMiddle, + xMiddle + halfWidth + 1, yMiddle); + if ( !(flags & wxCONTROL_EXPANDED) ) { // turn "-" into "+" - dc.DrawLine(xMiddle, yMiddle - 2, xMiddle, yMiddle + 3); + const wxCoord halfHeight = rect.height/2 - 2; + dc.DrawLine(xMiddle, yMiddle - halfHeight, + xMiddle, yMiddle + halfHeight + 1); } }