mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 03:32:48 +00:00
MergeDownLayerCommand: unlink before merge down a linked cel
This commit is contained in:
parent
3f99737758
commit
9740cfd08c
@ -24,6 +24,7 @@
|
||||
#include "app/cmd/add_cel.h"
|
||||
#include "app/cmd/replace_image.h"
|
||||
#include "app/cmd/set_cel_position.h"
|
||||
#include "app/cmd/unlink_cel.h"
|
||||
#include "app/commands/command.h"
|
||||
#include "app/context_access.h"
|
||||
#include "app/document.h"
|
||||
@ -147,6 +148,9 @@ void MergeDownLayerCommand::onExecute(Context* context)
|
||||
transaction.execute(new cmd::SetCelPosition(dst_cel,
|
||||
bounds.x, bounds.y));
|
||||
|
||||
if (dst_cel->links())
|
||||
transaction.execute(new cmd::UnlinkCel(dst_cel));
|
||||
|
||||
transaction.execute(new cmd::ReplaceImage(sprite,
|
||||
dst_cel->imageRef(), new_image));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user