From 11c8ba3605515035520c322d4f6a773e3367d1af Mon Sep 17 00:00:00 2001 From: David Capello Date: Sat, 13 Apr 2019 17:19:29 -0300 Subject: [PATCH] Fix merging down linked layers (https://community.aseprite.org/t/2894) --- src/app/commands/cmd_merge_down_layer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/commands/cmd_merge_down_layer.cpp b/src/app/commands/cmd_merge_down_layer.cpp index e705ad04a..a967acc5e 100644 --- a/src/app/commands/cmd_merge_down_layer.cpp +++ b/src/app/commands/cmd_merge_down_layer.cpp @@ -137,12 +137,14 @@ void MergeDownLayerCommand::onExecute(Context* context) opacity, src_layer->blendMode()); - tx(new cmd::SetCelPosition(dst_cel, - bounds.x, bounds.y)); - + // First unlink the dst_cel if (dst_cel->links()) tx(new cmd::UnlinkCel(dst_cel)); + // Then modify the dst_cel + tx(new cmd::SetCelPosition(dst_cel, + bounds.x, bounds.y)); + tx(new cmd::ReplaceImage(sprite, dst_cel->imageRef(), new_image)); }