Fix flatten layers command for linked cels

Avoid using the same linked cel in different frames when we merge layers.
This commit is contained in:
David Capello 2015-03-19 17:37:22 -03:00
parent 9302c5d1bb
commit f9131449fb

View File

@ -16,6 +16,7 @@
#include "app/cmd/copy_rect.h"
#include "app/cmd/remove_layer.h"
#include "app/cmd/remove_layer.h"
#include "app/cmd/unlink_cel.h"
#include "app/document.h"
#include "doc/cel.h"
#include "doc/layer.h"
@ -64,6 +65,9 @@ void FlattenLayers::onExecute()
ImageRef cel_image;
Cel* cel = background->cel(frame);
if (cel) {
if (cel->links())
executeAndAdd(new cmd::UnlinkCel(cel));
cel_image = cel->imageRef();
ASSERT(cel_image);