local numpoints = selection.numpoints(sel); */
| 200 | |
| 201 | /* local numpoints = selection.numpoints(sel); */ |
| 202 | staticfn int |
| 203 | l_selection_numpoints(lua_State *L) |
| 204 | { |
| 205 | struct selectionvar *sel = l_selection_check(L, 1); |
| 206 | coordxy x, y; |
| 207 | int ret = 0; |
| 208 | NhRect rect = cg.zeroNhRect; |
| 209 | |
| 210 | selection_getbounds(sel, &rect); |
| 211 | |
| 212 | for (x = rect.lx; x <= rect.hx; x++) |
| 213 | for (y = rect.ly; y <= rect.hy; y++) |
| 214 | if (selection_getpoint(x, y, sel)) |
| 215 | ret++; |
| 216 | |
| 217 | lua_settop(L, 0); |
| 218 | lua_pushinteger(L, ret); |
| 219 | return 1; |
| 220 | } |
| 221 | |
| 222 | /* local value = selection.get(sel, x, y); */ |
| 223 | staticfn int |
nothing calls this directly
no test coverage detected