Win32: Swap maskColor assignment based on alpha value

Looks like mask pixels was inverted.
This commit is contained in:
Dimitriy Ryazantcev
2026-07-05 17:19:20 +03:00
committed by Sam Lantinga
parent 8e3b6243fd
commit 362165ed9b

View File

@@ -605,7 +605,7 @@ HICON WIN_CreateIconFromSurface(SDL_Surface *surface)
for (int x = 0; x < width; x++) {
BYTE* pixel = (BYTE*)pBits + (y * width + x) * 4;
BYTE alpha = pixel[3];
COLORREF maskColor = (alpha == 0) ? RGB(0, 0, 0) : RGB(255, 255, 255);
COLORREF maskColor = (alpha == 0) ? RGB(255, 255, 255) : RGB(0, 0, 0);
SetPixel(hdcMem, x, y, maskColor);
}
}