Rather than coloring the square evenly OR rendering a board texture
cutout we now always do both. Drawing the color will then erase anything
that was on the square before, which is expected behavior, and will then
remain visible where the texture is transparent. Before any transparency
in the texture would leave the old square content (pieces, arrows,
markers) visible.
cr = cairo_create (dest);
cr = cairo_create (dest);
- if ((useTexture & color+1) && CutOutSquare(x, y, &x0, &y0, color)) {
- cairo_set_source_surface (cr, pngBoardBitmap[color], x*fac - x0, y*fac - y0);
- cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
- cairo_rectangle (cr, x*fac, y*fac, squareSize, squareSize);
- cairo_fill (cr);
- cairo_destroy (cr);
- } else { // evenly colored squares
+ { // evenly colored squares
char *col = NULL;
switch (color) {
case 0: col = appData.darkSquareColor; break;
char *col = NULL;
switch (color) {
case 0: col = appData.darkSquareColor; break;
cairo_rectangle (cr, fac*x, fac*y, squareSize, squareSize);
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
cairo_fill (cr);
cairo_rectangle (cr, fac*x, fac*y, squareSize, squareSize);
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
cairo_fill (cr);
+ if ((useTexture & color+1) && CutOutSquare(x, y, &x0, &y0, color)) {
+ cairo_set_source_surface (cr, pngBoardBitmap[color], x*fac - x0, y*fac - y0);
+ cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
+ cairo_rectangle (cr, x*fac, y*fac, squareSize, squareSize);
+ cairo_fill (cr);
+ }
+ cairo_destroy (cr);