From 0d188b7c6771c300fe0d63562c2bde7243a2de64 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Mon, 6 Jul 2020 22:36:25 -0400 Subject: Untangle: Implement game_get_cursor_location. --- untangle.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/untangle.c b/untangle.c index a270277..0d3e0e6 100644 --- a/untangle.c +++ b/untangle.c @@ -1587,6 +1587,17 @@ static void game_get_cursor_location(const game_ui *ui, const game_params *params, int *x, int *y, int *w, int *h) { + if(ui->dragpoint >= 0 || ui->cursorpoint >= 0) { + int idx = (ui->dragpoint >= 0) ? ui->dragpoint : ui->cursorpoint; + + int cx, cy; + cx = ds->x[idx]; + cy = ds->y[idx]; + + *x = cx - CIRCLE_RADIUS; + *y = cy - CIRCLE_RADIUS; + *w = *h = 2 * CIRCLE_RADIUS + 1; + } } static int game_status(const game_state *state) -- cgit v1.1