From: H.G. Muller Date: Fri, 5 Feb 2010 19:36:50 +0000 (+0100) Subject: Fix highlighting bug in XBoard X-Git-Tag: master-20100206~7 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=8fba2f04319bfc92a9611cb2434a209dfa1f34f5;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 581206c..715a7b3 100644 --- a/xboard.c +++ b/xboard.c @@ -3833,14 +3833,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); }