lua: add Selection(Rectangle) ctor

This commit is contained in:
David Capello 2018-09-07 14:47:17 -03:00
parent 6abda997d4
commit d91fe69c15

View File

@ -41,7 +41,13 @@ struct SelectionObj {
int Selection_new(lua_State* L)
{
push_new<SelectionObj>(L, new Mask, nullptr);
gfx::Rect bounds = convert_args_into_rect(L, 1);
auto mask = new Mask;
if (!bounds.isEmpty())
mask->replace(bounds);
push_new<SelectionObj>(L, mask, nullptr);
return 1;
}