centre frame decoration bitmaps in their buttons
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 20 Sep 2006 22:55:04 +0000 (22:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 20 Sep 2006 22:55:04 +0000 (22:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/univ/stdrend.cpp

index d184d762141ce5caa37186db366b8953e86da983..37f95f7aa7ff4fe7db9cac187f545a4af6a1b713 100644 (file)
@@ -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);
 }