local s = selection.fillrect(sel, x1,y1, x2,y2); */ local s = selection.fillrect(x1,y1, x2,y2); */ s:fillrect(x1,y1, x2,y2); */ selection.area(x1,y1, x2,y2); */
| 556 | /* s:fillrect(x1,y1, x2,y2); */ |
| 557 | /* selection.area(x1,y1, x2,y2); */ |
| 558 | staticfn int |
| 559 | l_selection_fillrect(lua_State *L) |
| 560 | { |
| 561 | struct selectionvar *sel = NULL; |
| 562 | int y; |
| 563 | coordxy x1, y1, x2, y2; |
| 564 | |
| 565 | if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) { |
| 566 | nhl_error(L, "selection.fillrect: illegal arguments"); |
| 567 | } |
| 568 | |
| 569 | get_location_coord(&x1, &y1, ANY_LOC, gc.coder ? gc.coder->croom : NULL, |
| 570 | SP_COORD_PACK(x1, y1)); |
| 571 | get_location_coord(&x2, &y2, ANY_LOC, gc.coder ? gc.coder->croom : NULL, |
| 572 | SP_COORD_PACK(x2, y2)); |
| 573 | |
| 574 | (void) l_selection_clone(L); |
| 575 | sel = l_selection_check(L, 2); |
| 576 | if (x1 == x2) { |
| 577 | for (y = y1; y <= y2; y++) |
| 578 | selection_setpoint(x1, y, sel, 1); |
| 579 | } else { |
| 580 | for (y = y1; y <= y2; y++) |
| 581 | selection_do_line(x1, y, x2, y, sel); |
| 582 | } |
| 583 | return 1; |
| 584 | } |
| 585 | |
| 586 | /* local s = selection.randline(sel, x1,y1, x2,y2, roughness); */ |
| 587 | /* local s = selection.randline(x1,y1, x2,y2, roughness); */ |
nothing calls this directly
no test coverage detected