local pt = selection.rndcoord(sel); */ local pt = selection.rndcoord(sel, 1); */
| 404 | /* local pt = selection.rndcoord(sel); */ |
| 405 | /* local pt = selection.rndcoord(sel, 1); */ |
| 406 | staticfn int |
| 407 | l_selection_rndcoord(lua_State *L) |
| 408 | { |
| 409 | struct selectionvar *sel = l_selection_check(L, 1); |
| 410 | int removeit = (int) luaL_optinteger(L, 2, 0); |
| 411 | coordxy x = -1, y = -1; |
| 412 | selection_rndcoord(sel, &x, &y, removeit); |
| 413 | if (!(x == -1 && y == -1)) { |
| 414 | update_croom(); |
| 415 | if (gc.coder && gc.coder->croom) { |
| 416 | x -= gc.coder->croom->lx; |
| 417 | y -= gc.coder->croom->ly; |
| 418 | } else { |
| 419 | x -= gx.xstart; |
| 420 | y -= gy.ystart; |
| 421 | } |
| 422 | } |
| 423 | lua_settop(L, 0); |
| 424 | lua_newtable(L); |
| 425 | nhl_add_table_entry_int(L, "x", x); |
| 426 | nhl_add_table_entry_int(L, "y", y); |
| 427 | return 1; |
| 428 | } |
| 429 | |
| 430 | /* local s = selection.room(); */ |
| 431 | staticfn int |
nothing calls this directly
no test coverage detected