From: H.G. Muller Date: Fri, 25 Feb 2011 13:38:21 +0000 (+0100) Subject: Improve repairing damage of arrow highlight XBoard X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=3f6b099b65718c49d05cf803ab74f9994d00b12b;p=xboard.git Improve repairing damage of arrow highlight XBoard With line gap the highlight arrow necessitated redrawing of the entire board, to repair damage on the grid. This interfered with flashing of pieces, which was only done on selective redraws. In stead of forcing a total repaint we now just redraw the grid lines. --- diff --git a/xboard.c b/xboard.c index f5254ea..2d3a155 100644 --- a/xboard.c +++ b/xboard.c @@ -4605,9 +4605,12 @@ void XDrawPosition(w, repaint, board) * but this causes a very distracting flicker. */ - if ( lineGap && IsDrawArrowEnabled()) repaint = True; if (!repaint && lastBoardValid[nr] && (nr == 1 || lastFlipView == flipView)) { + if ( lineGap && IsDrawArrowEnabled()) + XDrawSegments(xDisplay, xBoardWindow, lineGC, + gridSegments, BOARD_HEIGHT + BOARD_WIDTH + 2); + /* If too much changes (begin observing new game, etc.), don't do flashing */ do_flash = too_many_diffs(board, lastBoard[nr]) ? 0 : 1; @@ -9303,16 +9306,13 @@ void DrawArrowBetweenSquares( int s_col, int s_row, int d_col, int d_row ) DrawArrowBetweenPoints( s_x, s_y, d_x, d_y ); - if(lineGap == 0) { - // this is a good idea, but it only works when lineGap == 0, because 'damage' on grid lines is not repaired - hor = 64*s_col + 32; vert = 64*s_row + 32; - for(i=0; i<= 64; i++) { + hor = 64*s_col + 32; vert = 64*s_row + 32; + for(i=0; i<= 64; i++) { damage[0][vert+6>>6][hor+6>>6] = True; damage[0][vert-6>>6][hor+6>>6] = True; damage[0][vert+6>>6][hor-6>>6] = True; damage[0][vert-6>>6][hor-6>>6] = True; hor += d_col - s_col; vert += d_row - s_row; - } } }