From 87f92ae18b9ce2ad0f230609d7d90f2fbf0a1c7b Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 5 Oct 2012 19:16:30 +0200 Subject: [PATCH] Fix highlight clearing --- backend.c | 2 +- xboard.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index 7e8ed59..9333320 100644 --- a/backend.c +++ b/backend.c @@ -6755,7 +6755,7 @@ UserMoveEvent(int fromX, int fromY, int toX, int toY, int promoChar) } } - if(doubleClick) { // [HGM] exclude: move entered with double-click on from square is for exclusion, not playing + if(doubleClick && gameMode == AnalyzeMode) { // [HGM] exclude: move entered with double-click on from square is for exclusion, not playing if(ExcludeOneMove(fromY, fromX, toY, toX, promoChar, '*')) // toggle ClearPremoveHighlights(); // was included else ClearHighlights(), SetPremoveHighlights(ff, rf, ft, rt); // exclusion indicated by premove highlights diff --git a/xboard.c b/xboard.c index a0fa610..9c8be9b 100644 --- a/xboard.c +++ b/xboard.c @@ -2534,11 +2534,17 @@ DoDrawBorder (cairo_surface_t *cs, int x, int y, int type) { cairo_t *cr; DrawSeekOpen(); + char *col; + switch(type) { + case 0: col = "#000000"; break; + case 1: col = appData.highlightSquareColor; break; + case 2: col = appData.premoveHighlightColor; break; + } cr = cairo_create(cs); cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); cairo_rectangle(cr, x, y, squareSize+lineGap, squareSize+lineGap); - SetPen(cr, lineGap, type == 1 ? appData.highlightSquareColor : appData.premoveHighlightColor, 0); + SetPen(cr, lineGap, col, 0); cairo_stroke(cr); } -- 1.7.0.4