From: H.G. Muller Date: Sun, 21 Oct 2012 07:58:23 +0000 (+0200) Subject: Prevent odd-width line shift in length direction X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c89e0e6449ce73de45d17ccb6e7d4c6e918abb72;p=xboard.git Prevent odd-width line shift in length direction --- diff --git a/draw.c b/draw.c index 7ec60ae..82c5582 100644 --- a/draw.c +++ b/draw.c @@ -518,8 +518,9 @@ DrawGrid() /* lines in X */ for (i = 0; i < BOARD_WIDTH + BOARD_HEIGHT + 2; i++) { - cairo_move_to (cr, gridSegments[i].x1 + odd, gridSegments[i].y1 + odd); - cairo_line_to (cr, gridSegments[i].x2 + odd, gridSegments[i].y2 + odd); + int h = (gridSegments[i].y1 == gridSegments[i].y2); // horizontal + cairo_move_to (cr, gridSegments[i].x1 + !h*odd, gridSegments[i].y1 + h*odd); + cairo_line_to (cr, gridSegments[i].x2 + !h*odd, gridSegments[i].y2 + h*odd); cairo_stroke (cr); }