local sel = selection.area(4,5, 40,10) | selection.rect(7,8, 60,14); */
| 303 | |
| 304 | /* local sel = selection.area(4,5, 40,10) | selection.rect(7,8, 60,14); */ |
| 305 | staticfn int |
| 306 | l_selection_or(lua_State *L) |
| 307 | { |
| 308 | int x,y; |
| 309 | struct selectionvar *sela = l_selection_check(L, 1); |
| 310 | struct selectionvar *selb = l_selection_check(L, 2); |
| 311 | struct selectionvar *selr = l_selection_push_new(L); |
| 312 | NhRect rect = cg.zeroNhRect; |
| 313 | |
| 314 | rect_bounds(sela->bounds, selb->bounds, &rect); |
| 315 | |
| 316 | for (x = rect.lx; x <= rect.hx; x++) |
| 317 | for (y = rect.ly; y <= rect.hy; y++) { |
| 318 | int val = (selection_getpoint(x, y, sela) |
| 319 | | selection_getpoint(x, y, selb)); |
| 320 | |
| 321 | selection_setpoint(x, y, selr, val); |
| 322 | } |
| 323 | selr->bounds = rect; |
| 324 | |
| 325 | lua_remove(L, 1); |
| 326 | lua_remove(L, 1); |
| 327 | return 1; |
| 328 | } |
| 329 | |
| 330 | /* local sel = selection.area(4,5, 40,10) ~ selection.rect(7,8, 60,14); */ |
| 331 | staticfn int |
nothing calls this directly
no test coverage detected