local s = selection.rect(sel, x1,y1, x2,y2); */
| 528 | |
| 529 | /* local s = selection.rect(sel, x1,y1, x2,y2); */ |
| 530 | staticfn int |
| 531 | l_selection_rect(lua_State *L) |
| 532 | { |
| 533 | struct selectionvar *sel = NULL; |
| 534 | coordxy x1, y1, x2, y2; |
| 535 | |
| 536 | if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) { |
| 537 | nhl_error(L, "selection.rect: illegal arguments"); |
| 538 | } |
| 539 | |
| 540 | get_location_coord(&x1, &y1, ANY_LOC, gc.coder ? gc.coder->croom : NULL, |
| 541 | SP_COORD_PACK(x1, y1)); |
| 542 | get_location_coord(&x2, &y2, ANY_LOC, gc.coder ? gc.coder->croom : NULL, |
| 543 | SP_COORD_PACK(x2, y2)); |
| 544 | |
| 545 | (void) l_selection_clone(L); |
| 546 | sel = l_selection_check(L, 2); |
| 547 | selection_do_line(x1, y1, x2, y1, sel); |
| 548 | selection_do_line(x1, y1, x1, y2, sel); |
| 549 | selection_do_line(x2, y1, x2, y2, sel); |
| 550 | selection_do_line(x1, y2, x2, y2, sel); |
| 551 | return 1; |
| 552 | } |
| 553 | |
| 554 | /* local s = selection.fillrect(sel, x1,y1, x2,y2); */ |
| 555 | /* local s = selection.fillrect(x1,y1, x2,y2); */ |
nothing calls this directly
no test coverage detected