summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/untangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/puzzles/untangle.c')
-rw-r--r--apps/plugins/puzzles/untangle.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/plugins/puzzles/untangle.c b/apps/plugins/puzzles/untangle.c
index d46afcbe66..839013809b 100644
--- a/apps/plugins/puzzles/untangle.c
+++ b/apps/plugins/puzzles/untangle.c
@@ -1162,17 +1162,18 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1162 { 1162 {
1163 if(ui->dragpoint < 0) 1163 if(ui->dragpoint < 0)
1164 { 1164 {
1165 if(ui->cursorpoint < 0)
1166 {
1167 ui->cursorpoint = 0;
1168 return "";
1169 }
1170
1165 /* We're selecting a point here. */ 1171 /* We're selecting a point here. */
1166 /* Search all the points and find the closest one (2-D) in 1172 /* Search all the points and find the closest one (2-D) in
1167 * the given direction. */ 1173 * the given direction. */
1168 int i, best; 1174 int i, best;
1169 long bestd; 1175 long bestd;
1170 1176
1171 if(ui->cursorpoint < 0)
1172 {
1173 ui->cursorpoint = 0;
1174 }
1175
1176 /* 1177 /*
1177 * Begin drag. We drag the vertex _nearest_ to the pointer, 1178 * Begin drag. We drag the vertex _nearest_ to the pointer,
1178 * just in case one is nearly on top of another and we want 1179 * just in case one is nearly on top of another and we want
@@ -1195,7 +1196,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1195 /* Figure out if this point falls into a 90 degree 1196 /* Figure out if this point falls into a 90 degree
1196 * range extending from the current point */ 1197 * range extending from the current point */
1197 1198
1198 float angle = atan2(-dy, dx); /* negate y to adjust for raster coordinates */ 1199 float angle = atan2(-dy, dx); /* adjust for raster coordinates */
1199 1200
1200 /* offset to [0..2*PI] */ 1201 /* offset to [0..2*PI] */
1201 if(angle < 0) 1202 if(angle < 0)
@@ -1493,8 +1494,6 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1493 ds->bg = bg; 1494 ds->bg = bg;
1494 1495
1495 game_compute_size(&state->params, ds->tilesize, &w, &h); 1496 game_compute_size(&state->params, ds->tilesize, &w, &h);
1496
1497 clip(dr, 0, 0, w, h);
1498 draw_rect(dr, 0, 0, w, h, bg); 1497 draw_rect(dr, 0, 0, w, h, bg);
1499 1498
1500 /* 1499 /*