From c89e0e6449ce73de45d17ccb6e7d4c6e918abb72 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 21 Oct 2012 09:58:23 +0200 Subject: [PATCH] Prevent odd-width line shift in length direction --- draw.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) 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); } -- 1.7.0.4