Use correct bitmap size on Mac

This commit is contained in:
JulianSmart
2017-05-20 14:52:22 +01:00
parent 89927282fe
commit 47db6e9d5e

View File

@@ -734,7 +734,7 @@ wxSize wxWizard::GetPageSize() const
if ( m_statbmp ) if ( m_statbmp )
{ {
// make the page at least as tall as the bitmap // make the page at least as tall as the bitmap
pageSize.IncTo(wxSize(0, m_bitmap.GetHeight())); pageSize.IncTo(wxSize(0, m_bitmap.GetScaledHeight()));
} }
if ( m_usingSizer ) if ( m_usingSizer )
@@ -948,10 +948,10 @@ bool wxWizard::ResizeBitmap(wxBitmap& bmp)
wxSize pageSize = m_sizerPage->GetSize(); wxSize pageSize = m_sizerPage->GetSize();
if (pageSize == wxSize(0,0)) if (pageSize == wxSize(0,0))
pageSize = GetPageSize(); pageSize = GetPageSize();
int bitmapWidth = wxMax(bmp.GetWidth(), GetMinimumBitmapWidth()); int bitmapWidth = wxMax(bmp.GetScaledWidth(), GetMinimumBitmapWidth());
int bitmapHeight = pageSize.y; int bitmapHeight = pageSize.y;
if (!m_statbmp->GetBitmap().IsOk() || m_statbmp->GetBitmap().GetHeight() != bitmapHeight) if (!m_statbmp->GetBitmap().IsOk() || m_statbmp->GetBitmap().GetScaledHeight() != bitmapHeight)
{ {
wxBitmap bitmap(bitmapWidth, bitmapHeight); wxBitmap bitmap(bitmapWidth, bitmapHeight);
{ {
@@ -971,16 +971,16 @@ bool wxWizard::ResizeBitmap(wxBitmap& bmp)
if (GetBitmapPlacement() & wxWIZARD_HALIGN_LEFT) if (GetBitmapPlacement() & wxWIZARD_HALIGN_LEFT)
x = 0; x = 0;
else if (GetBitmapPlacement() & wxWIZARD_HALIGN_RIGHT) else if (GetBitmapPlacement() & wxWIZARD_HALIGN_RIGHT)
x = bitmapWidth - bmp.GetWidth(); x = bitmapWidth - bmp.GetScaledWidth();
else else
x = (bitmapWidth - bmp.GetWidth())/2; x = (bitmapWidth - bmp.GetScaledWidth())/2;
if (GetBitmapPlacement() & wxWIZARD_VALIGN_TOP) if (GetBitmapPlacement() & wxWIZARD_VALIGN_TOP)
y = 0; y = 0;
else if (GetBitmapPlacement() & wxWIZARD_VALIGN_BOTTOM) else if (GetBitmapPlacement() & wxWIZARD_VALIGN_BOTTOM)
y = bitmapHeight - bmp.GetHeight(); y = bitmapHeight - bmp.GetScaledHeight();
else else
y = (bitmapHeight - bmp.GetHeight())/2; y = (bitmapHeight - bmp.GetScaledHeight())/2;
dc.DrawBitmap(bmp, x, y, true); dc.DrawBitmap(bmp, x, y, true);
dc.SelectObject(wxNullBitmap); dc.SelectObject(wxNullBitmap);
@@ -996,8 +996,8 @@ bool wxWizard::ResizeBitmap(wxBitmap& bmp)
bool wxWizard::TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap) bool wxWizard::TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap)
{ {
int w = bitmap.GetWidth(); int w = bitmap.GetScaledWidth();
int h = bitmap.GetHeight(); int h = bitmap.GetScaledHeight();
wxMemoryDC dcMem; wxMemoryDC dcMem;
@@ -1007,7 +1007,7 @@ bool wxWizard::TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap)
for (i = rect.x; i < rect.x + rect.width; i += w) for (i = rect.x; i < rect.x + rect.width; i += w)
{ {
for (j = rect.y; j < rect.y + rect.height; j+= h) for (j = rect.y; j < rect.y + rect.height; j+= h)
dc.Blit(i, j, bitmap.GetWidth(), bitmap.GetHeight(), & dcMem, 0, 0); dc.Blit(i, j, bitmap.GetScaledWidth(), bitmap.GetScaledHeight(), & dcMem, 0, 0);
} }
dcMem.SelectObject(wxNullBitmap); dcMem.SelectObject(wxNullBitmap);