From ae812854535d5f4f0ce998f652b3a4dbad0095b6 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 26 Apr 2005 08:20:25 +0000 Subject: [PATCH] Fix trivial UI glitch involving clicking on the border outside the grid. I'm really starting to get annoyed by the default round- towards-zero behaviour of C integer division. git-svn-id: svn://svn.tartarus.org/sgt/puzzles@5681 cda61777-01e9-0310-a592-d414129be87e --- solo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solo.c b/solo.c index a023eff..8ef1cad 100644 --- a/solo.c +++ b/solo.c @@ -1209,8 +1209,8 @@ static game_state *make_move(game_state *from, game_ui *ui, int x, int y, int tx, ty; game_state *ret; - tx = (x - BORDER) / TILE_SIZE; - ty = (y - BORDER) / TILE_SIZE; + tx = (x + TILE_SIZE - BORDER) / TILE_SIZE - 1; + ty = (y + TILE_SIZE - BORDER) / TILE_SIZE - 1; if (tx >= 0 && tx < cr && ty >= 0 && ty < cr && button == LEFT_BUTTON) { if (tx == ui->hx && ty == ui->hy) { -- 2.11.0