mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-22 06:41:08 +00:00
lua: add Selection(Rectangle) ctor
This commit is contained in:
parent
6abda997d4
commit
d91fe69c15
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user