Use wxBitmap::GetLogicalXXX() instead of GetScaledXXX()

Replace old functions with the new ones in the library code itself.

Note that wxSTC and wxRichText still use GetScaledXXX(), but they're
different functions that might need to be renamed/dealt with separately.
This commit is contained in:
Vadim Zeitlin
2022-01-22 18:57:31 +00:00
parent 65bb454311
commit a81e0d83c1
29 changed files with 151 additions and 151 deletions

View File

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