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/trunk@78089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2014-11-04 16:21:00 +00:00
parent 06ddf44a27
commit 642528bf5e

View File

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