Fix simulated toggle in OS X wxToolBar wiht HiDPI bitmaps

Use scaled size and scale factor when creating wxMemoryDC so that the
modified output bitmap has same physical dimensions as the source one.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2014-11-04 16:21:13 +00:00
parent 65b887c35f
commit 6a4b12865a

View File

@@ -563,9 +563,10 @@ void wxToolBarTool::UpdateImages()
if ( CanBeToggled() ) if ( CanBeToggled() )
{ {
int w = m_bmpNormal.GetWidth(); int w = m_bmpNormal.GetScaledWidth();
int h = m_bmpNormal.GetHeight(); int h = m_bmpNormal.GetScaledHeight();
m_alternateBitmap = wxBitmap( w, h ); m_alternateBitmap = wxBitmap();
m_alternateBitmap.CreateScaled(w, h, -1, m_bmpNormal.GetScaleFactor());
wxMemoryDC dc; wxMemoryDC dc;
dc.SelectObject(m_alternateBitmap); dc.SelectObject(m_alternateBitmap);