mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
[lua] Add undo information in Sprite:newSlice() (fix #3393)
This commit is contained in:
parent
c00f4b0d26
commit
7aa90db770
@ -11,6 +11,7 @@
|
||||
|
||||
#include "app/app.h"
|
||||
#include "app/cmd/add_layer.h"
|
||||
#include "app/cmd/add_slice.h"
|
||||
#include "app/cmd/assign_color_profile.h"
|
||||
#include "app/cmd/clear_cel.h"
|
||||
#include "app/cmd/convert_color_profile.h"
|
||||
@ -571,7 +572,10 @@ int Sprite_newSlice(lua_State* L)
|
||||
if (!bounds.isEmpty())
|
||||
slice->insert(0, doc::SliceKey(bounds));
|
||||
|
||||
sprite->slices().add(slice);
|
||||
Tx tx;
|
||||
tx(new cmd::AddSlice(sprite, slice));
|
||||
tx.commit();
|
||||
|
||||
push_docobj(L, slice);
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user