From: H.G. Muller Date: Fri, 5 Feb 2010 19:36:50 +0000 (+0100) Subject: Fix highlighting bug in XBoard X-Git-Tag: v4.4.3.20100220~15 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=59d1333eb463402beb7ef0e0606d99245eda8af4;p=xboard.git Fix highlighting bug in XBoard The from-square was drawn before the to-square was erased, which led to a missing highlight line if they shared an edge or corner. --- diff --git a/xboard.c b/xboard.c index 4a47133..d4d8369 100644 --- a/xboard.c +++ b/xboard.c @@ -4549,14 +4549,18 @@ SetHighlights(fromX, fromY, toX, toY) if (hi1X >= 0 && hi1Y >= 0) { drawHighlight(hi1X, hi1Y, lineGC); } + } // [HGM] first erase both, then draw new! + if (hi2X != toX || hi2Y != toY) { + if (hi2X >= 0 && hi2Y >= 0) { + drawHighlight(hi2X, hi2Y, lineGC); + } + } + if (hi1X != fromX || hi1Y != fromY) { if (fromX >= 0 && fromY >= 0) { drawHighlight(fromX, fromY, highlineGC); } } if (hi2X != toX || hi2Y != toY) { - if (hi2X >= 0 && hi2Y >= 0) { - drawHighlight(hi2X, hi2Y, lineGC); - } if (toX >= 0 && toY >= 0) { drawHighlight(toX, toY, highlineGC); }