Rectangles: use new move_cursor() features

This commit is contained in:
Ben Harris
2023-08-11 00:39:28 +01:00
parent f7c2d45fba
commit 2aa5708bc7

8
rect.c
View File

@ -2415,11 +2415,11 @@ static char *interpret_move(const game_state *from, game_ui *ui,
enddrag = true; enddrag = true;
erasing = (button == RIGHT_RELEASE); erasing = (button == RIGHT_RELEASE);
} else if (IS_CURSOR_MOVE(button)) { } else if (IS_CURSOR_MOVE(button)) {
move_cursor(button, &ui->cur_x, &ui->cur_y, from->w, from->h, false, char *ret;
NULL); ret = move_cursor(button, &ui->cur_x, &ui->cur_y, from->w, from->h,
ui->cur_visible = true; false, &ui->cur_visible);
active = true; active = true;
if (!ui->cur_dragging) return MOVE_UI_UPDATE; if (!ui->cur_dragging || ret != MOVE_UI_UPDATE) return ret;
coord_round((float)ui->cur_x + 0.5F, (float)ui->cur_y + 0.5F, &xc, &yc); coord_round((float)ui->cur_x + 0.5F, (float)ui->cur_y + 0.5F, &xc, &yc);
} else if (IS_CURSOR_SELECT(button)) { } else if (IS_CURSOR_SELECT(button)) {
if (ui->drag_start_x >= 0 && !ui->cur_dragging) { if (ui->drag_start_x >= 0 && !ui->cur_dragging) {