From 2f86939a560feeaa5d440beb776bc6dadcee1895 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 5 Oct 2012 18:29:13 +0200 Subject: [PATCH] Let cairo also do evenly colored squares. --- xboard.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/xboard.c b/xboard.c index 84a4170..8ffd5ce 100644 --- a/xboard.c +++ b/xboard.c @@ -2602,6 +2602,24 @@ BlankSquare (int x, int y, int color, ChessSquare piece, Drawable dest, int fac) XCopyArea(xDisplay, xpmBoardBitmap[color], dest, wlPieceGC, x0, y0, squareSize, squareSize, x*fac, y*fac); } else + if(csBoardWindow) { + cairo_t *cr = cairo_create (csBoardWindow); + char *col; + switch (color) { + case 0: col = appData.darkSquareColor; break; + case 1: col = appData.lightSquareColor; break; + case 2: col = "#000000"; break; + } + SetPen(cr, 2.0, col, 0); + cairo_rectangle (cr, x, y, squareSize, squareSize); + cairo_fill (cr); + cairo_destroy (cr); + cr = cairo_create (csBoardBackup); + SetPen(cr, 2.0, col, 0); + cairo_rectangle (cr, x, y, squareSize, squareSize); + cairo_fill (cr); + cairo_destroy (cr); + } else if (useImages && useImageSqs) { Pixmap pm; switch (color) { -- 1.7.0.4