From 38f3c668b6af5e5ddda6bbc62c6cf42d393518fa Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 18 Sep 2018 09:24:52 -0300 Subject: [PATCH] Flattening one image layer will flatten all layers anyway (the same is not true for groups) --- src/app/commands/cmd_flatten_layers.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/commands/cmd_flatten_layers.cpp b/src/app/commands/cmd_flatten_layers.cpp index d0fce61f0..b7a660853 100644 --- a/src/app/commands/cmd_flatten_layers.cpp +++ b/src/app/commands/cmd_flatten_layers.cpp @@ -74,7 +74,11 @@ void FlattenLayersCommand::onExecute(Context* context) range = App::instance()->timeline()->range(); #endif - if (!range.enabled()) { + // If the range is not selected or we have only one image layer + // selected, we'll flatten all layers. + if (!range.enabled() || + (range.selectedLayers().size() == 1 && + (*range.selectedLayers().begin())->isImage())) { for (auto layer : sprite->root()->layers()) range.selectLayer(layer); }