| 281 | } |
| 282 | |
| 283 | int |
| 284 | selection_rndcoord( |
| 285 | struct selectionvar *ov, |
| 286 | coordxy *x, coordxy *y, |
| 287 | boolean removeit) |
| 288 | { |
| 289 | int idx = 0; |
| 290 | int c; |
| 291 | int dx, dy; |
| 292 | NhRect rect = cg.zeroNhRect; |
| 293 | |
| 294 | selection_getbounds(ov, &rect); |
| 295 | |
| 296 | for (dx = rect.lx; dx <= rect.hx; dx++) |
| 297 | for (dy = rect.ly; dy <= rect.hy; dy++) |
| 298 | if (selection_getpoint(dx, dy, ov)) |
| 299 | idx++; |
| 300 | |
| 301 | if (idx) { |
| 302 | c = rn2(idx); |
| 303 | for (dx = rect.lx; dx <= rect.hx; dx++) |
| 304 | for (dy = rect.ly; dy <= rect.hy; dy++) |
| 305 | if (selection_getpoint(dx, dy, ov)) { |
| 306 | if (!c) { |
| 307 | *x = dx; |
| 308 | *y = dy; |
| 309 | if (removeit) |
| 310 | selection_setpoint(dx, dy, ov, 0); |
| 311 | return 1; |
| 312 | } |
| 313 | c--; |
| 314 | } |
| 315 | } |
| 316 | *x = *y = -1; |
| 317 | return 0; |
| 318 | } |
| 319 | |
| 320 | void |
| 321 | selection_do_grow(struct selectionvar *ov, int dir) |
no test coverage detected