Fix return type of wxBitmap::UseAlpha() under wxMSW

The method should return bool but was returning void.

This commit is best viewed ignoring whitespace-only changes.

Closes #23903, #23919.
This commit is contained in:
PB 2023-09-30 21:39:42 +02:00 committed by Vadim Zeitlin
parent 3c6869605e
commit 5ca3157467
2 changed files with 8 additions and 9 deletions

View file

@ -177,7 +177,7 @@ public:
void SetMask(wxMask *mask);
bool HasAlpha() const;
void UseAlpha(bool use = true);
bool UseAlpha(bool use = true);
void ResetAlpha() { UseAlpha(false); }
// old synonyms for CreateWithDIPSize() and GetLogicalXXX() functions

View file

@ -1222,16 +1222,15 @@ wxDC *wxBitmap::GetSelectedInto() const
#endif
}
void wxBitmap::UseAlpha(bool use)
bool wxBitmap::UseAlpha(bool use)
{
if ( GetBitmapData() )
{
// Only 32bpp bitmaps can contain alpha channel.
if ( use && GetBitmapData()->m_depth < 32 )
use = false;
// Only 32bpp bitmaps can contain alpha channel.
if ( !GetBitmapData() || (use && GetBitmapData()->m_depth < 32) )
return false;
GetBitmapData()->m_hasAlpha = use;
}
GetBitmapData()->m_hasAlpha = use;
return true;
}
bool wxBitmap::HasAlpha() const