Make wxBitmap ctors consistent wrt passing scale for conversion from wxImage; HiDPI adaptation for propgrid buffer and wxRTC images

This commit is contained in:
JulianSmart
2015-11-15 12:49:25 +00:00
parent fdbed751dc
commit a797c9d956
13 changed files with 38 additions and 22 deletions

View File

@@ -4660,13 +4660,15 @@ void wxPropertyGrid::OnResize( wxSizeEvent& event )
if ( !HasExtraStyle(wxPG_EX_NATIVE_DOUBLE_BUFFERING) )
{
double scaleFactor = GetContentScaleFactor();
int dblh = (m_lineHeight*2);
if ( !m_doubleBuffer )
{
// Create double buffer bitmap to draw on, if none
int w = wxMax(width, 250);
int h = wxMax(height + dblh, 400);
m_doubleBuffer = new wxBitmap( w, h );
m_doubleBuffer = new wxBitmap;
m_doubleBuffer->CreateScaled( w, h, wxBITMAP_SCREEN_DEPTH, scaleFactor );
}
else
{
@@ -4679,7 +4681,8 @@ void wxPropertyGrid::OnResize( wxSizeEvent& event )
if ( w < width ) w = width;
if ( h < (height+dblh) ) h = height + dblh;
delete m_doubleBuffer;
m_doubleBuffer = new wxBitmap( w, h );
m_doubleBuffer = new wxBitmap;
m_doubleBuffer->CreateScaled( w, h, wxBITMAP_SCREEN_DEPTH, scaleFactor );
}
}
}