Handle the (probably rare) case where the icon has no mask.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -139,7 +139,7 @@ void wxTaskBarIconArea::SetTrayIcon(const wxBitmap& bmp)
|
|||||||
// determine suitable bitmap size:
|
// determine suitable bitmap size:
|
||||||
wxSize winsize(GetSize());
|
wxSize winsize(GetSize());
|
||||||
wxSize bmpsize(m_bmp.GetWidth(), m_bmp.GetHeight());
|
wxSize bmpsize(m_bmp.GetWidth(), m_bmp.GetHeight());
|
||||||
wxSize iconsize(wxMin(winsize.x, bmpsize.x), wxMin(winsize.y, bmpsize.y));
|
wxSize iconsize(wxMin(winsize.x-2, bmpsize.x), wxMin(winsize.y-2, bmpsize.y));
|
||||||
|
|
||||||
// rescale the bitmap to fit into the tray icon window:
|
// rescale the bitmap to fit into the tray icon window:
|
||||||
if (bmpsize != iconsize)
|
if (bmpsize != iconsize)
|
||||||
@@ -149,7 +149,11 @@ void wxTaskBarIconArea::SetTrayIcon(const wxBitmap& bmp)
|
|||||||
m_bmp = wxBitmap(img);
|
m_bmp = wxBitmap(img);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRegion region(m_bmp);
|
wxRegion region;
|
||||||
|
if (m_bmp.GetMask())
|
||||||
|
region.Union(m_bmp);
|
||||||
|
else
|
||||||
|
region.Union(0,0, iconsize.x, iconsize.y);
|
||||||
|
|
||||||
// if the bitmap is smaller than the window, offset it:
|
// if the bitmap is smaller than the window, offset it:
|
||||||
if (winsize != iconsize)
|
if (winsize != iconsize)
|
||||||
|
Reference in New Issue
Block a user