[lua] Fix Sprite:newTag() so it generates undo info and can be used in transactions

This commit is contained in:
David Capello 2019-09-11 15:02:27 -03:00
parent 138cd2970c
commit fe42245ed9

View File

@ -500,7 +500,11 @@ int Sprite_newTag(lua_State* L)
auto from = get_frame_number_from_arg(L, 2);
auto to = get_frame_number_from_arg(L, 3);
auto tag = new doc::FrameTag(from, to);
sprite->frameTags().add(tag);
Tx tx;
tx(new cmd::AddFrameTag(sprite, tag));
tx.commit();
push_docobj(L, tag);
return 1;
}