Move scale factor-related wxBitmap functions out of line
This will make it possible to change them later without breaking ABI, which is probably worth paying the price of a function call (assuming the compiler could de-virtualize this call and inline it before). No real changes.
This commit is contained in:
@@ -196,6 +196,39 @@ public:
|
||||
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapBaseModule, wxModule);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Trivial implementations of scale-factor related functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxBitmapBase::CreateScaled(int w, int h, int d, double logicalScale)
|
||||
{
|
||||
return Create(wxRound(w*logicalScale), wxRound(h*logicalScale), d);
|
||||
}
|
||||
|
||||
void wxBitmapBase::SetScaleFactor(double WXUNUSED(scale))
|
||||
{
|
||||
}
|
||||
|
||||
double wxBitmapBase::GetScaleFactor() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
double wxBitmapBase::GetScaledWidth() const
|
||||
{
|
||||
return GetWidth() / GetScaleFactor();
|
||||
}
|
||||
|
||||
double wxBitmapBase::GetScaledHeight() const
|
||||
{
|
||||
return GetHeight() / GetScaleFactor();
|
||||
}
|
||||
|
||||
wxSize wxBitmapBase::GetScaledSize() const
|
||||
{
|
||||
return wxSize(wxRound(GetScaledWidth()), wxRound(GetScaledHeight()));
|
||||
}
|
||||
|
||||
#endif // wxUSE_BITMAP_BASE
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user