From: Vadim Zeitlin Date: Wed, 20 Sep 2006 22:55:04 +0000 (+0000) Subject: centre frame decoration bitmaps in their buttons X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d2328d9822495e812917890e4854c4bdfa9664cc?ds=inline centre frame decoration bitmaps in their buttons git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/univ/stdrend.cpp b/src/univ/stdrend.cpp index d184d76214..37f95f7aa7 100644 --- a/src/univ/stdrend.cpp +++ b/src/univ/stdrend.cpp @@ -1383,22 +1383,23 @@ void wxStdRenderer::DrawFrameButton(wxDC& dc, if ( !bmp.Ok() ) return; - wxRect r(x, y, FRAME_BUTTON_WIDTH, FRAME_BUTTON_HEIGHT); + wxRect rectBtn(x, y, FRAME_BUTTON_WIDTH, FRAME_BUTTON_HEIGHT); if ( flags & wxCONTROL_PRESSED ) { - DrawSunkenBorder(dc, &r); + DrawSunkenBorder(dc, &rectBtn); - r.x++; - r.y++; + rectBtn.x++; + rectBtn.y++; } else { - DrawRaisedBorder(dc, &r); + DrawRaisedBorder(dc, &rectBtn); } - DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), r); + DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rectBtn); - dc.DrawBitmap(bmp, r.x, r.y, true); + wxRect rectBmp(0, 0, bmp.GetWidth(), bmp.GetHeight()); + dc.DrawBitmap(bmp, rectBmp.CentreIn(rectBtn).GetPosition(), true); }