Fix creating cursor from XBM data with GTK3, see #17916
This commit is contained in:
@@ -109,9 +109,9 @@ wxCursor::wxCursor(const char bits[], int width, int height,
|
|||||||
#ifdef __WXGTK3__
|
#ifdef __WXGTK3__
|
||||||
wxBitmap bitmap(bits, width, height);
|
wxBitmap bitmap(bits, width, height);
|
||||||
if (maskBits)
|
if (maskBits)
|
||||||
bitmap.SetMask(new wxMask(wxBitmap(maskBits, width, height)));
|
bitmap.SetMask(new wxMask(wxBitmap(maskBits, width, height), *wxWHITE));
|
||||||
GdkPixbuf* pixbuf = bitmap.GetPixbuf();
|
GdkPixbuf* pixbuf = bitmap.GetPixbuf();
|
||||||
if (fg || bg)
|
if ((fg && *fg != *wxBLACK) || (bg && *bg != *wxWHITE))
|
||||||
{
|
{
|
||||||
const int stride = gdk_pixbuf_get_rowstride(pixbuf);
|
const int stride = gdk_pixbuf_get_rowstride(pixbuf);
|
||||||
const int n_channels = gdk_pixbuf_get_n_channels(pixbuf);
|
const int n_channels = gdk_pixbuf_get_n_channels(pixbuf);
|
||||||
@@ -121,7 +121,7 @@ wxCursor::wxCursor(const char bits[], int width, int height,
|
|||||||
guchar* p = data;
|
guchar* p = data;
|
||||||
for (int i = 0; i < width; i++, p += n_channels)
|
for (int i = 0; i < width; i++, p += n_channels)
|
||||||
{
|
{
|
||||||
if (p[0])
|
if (p[0] == 0)
|
||||||
{
|
{
|
||||||
if (fg)
|
if (fg)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user