diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 507739065..664d8e885 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -7,7 +7,7 @@ Various contributors (see below, and AUTHORS.txt) http://www.tuxpaint.org/ -2022.September.2 (0.9.29) +2022.September.4 (0.9.29) * Improvements to "Stamp" tool: ----------------------------- * WIP - Stamps may now be rotated. @@ -17,6 +17,12 @@ http://www.tuxpaint.org/ * Bug Fixes: ---------- + * Always creating 24-bit canvases, in an attempt to avoid blending + artifacts, e.g., when applying brush strokes using the Paint tool. + (Previously, we were using the display's color depth and masks, + which seemed to work fine under SDL1.2, but does not under SDL2.) + Closes https://sourceforge.net/p/tuxpaint/bugs/259/ + * Opening and immediately dismissing Color Mixer could cause an unexpected color to be chosen. h/t @kentonyanamin on Twitter for reporting. diff --git a/src/tuxpaint.c b/src/tuxpaint.c index dce9e1e3a..16a82561d 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -28079,13 +28079,15 @@ static void setup(void) printf("Canvas size is %d x %d\n", canvas_width, canvas_height); #endif - canvas = SDL_CreateRGBSurface(screen->flags, canvas_width, canvas_height, - screen->format->BitsPerPixel, - screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, 0); + /* Per https://wiki.libsdl.org/SDL_CreateRGBSurface, + * the flags are unused and should be set to 0 + * Using zeros for the RGB masks sets a default value, based on the depth. + */ + canvas = SDL_CreateRGBSurface(0, canvas_width, canvas_height, + 24, 0, 0, 0, 0); - save_canvas = SDL_CreateRGBSurface(screen->flags, canvas_width, canvas_height, - screen->format->BitsPerPixel, - screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, 0); + save_canvas = SDL_CreateRGBSurface(0, canvas_width, canvas_height, + 24, 0, 0, 0, 0); img_starter = NULL;