Remove DocumentApi::flattenLayers()

This commit is contained in:
David Capello 2017-05-19 11:10:56 -03:00
parent 7837a123f8
commit 4b7a90318a
3 changed files with 4 additions and 12 deletions

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2001-2015 David Capello
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -8,12 +8,12 @@
#include "config.h"
#endif
#include "app/cmd/flatten_layers.h"
#include "app/commands/command.h"
#include "app/context_access.h"
#include "app/document_api.h"
#include "app/modules/gui.h"
#include "app/ui/color_bar.h"
#include "app/transaction.h"
#include "app/ui/color_bar.h"
#include "doc/sprite.h"
namespace app {
@ -43,11 +43,10 @@ bool FlattenLayersCommand::onEnabled(Context* context)
void FlattenLayersCommand::onExecute(Context* context)
{
ContextWriter writer(context);
Document* document = writer.document();
Sprite* sprite = writer.sprite();
{
Transaction transaction(writer.context(), "Flatten Layers");
document->getApi(transaction).flattenLayers(sprite);
transaction.execute(new cmd::FlattenLayers(sprite));
transaction.commit();
}
update_screen_for_document(writer.document());

View File

@ -18,7 +18,6 @@
#include "app/cmd/clear_image.h"
#include "app/cmd/copy_cel.h"
#include "app/cmd/copy_frame.h"
#include "app/cmd/flatten_layers.h"
#include "app/cmd/flip_image.h"
#include "app/cmd/layer_from_background.h"
#include "app/cmd/move_cel.h"
@ -480,11 +479,6 @@ void DocumentApi::layerFromBackground(Layer* layer)
m_transaction.execute(new cmd::LayerFromBackground(layer));
}
void DocumentApi::flattenLayers(Sprite* sprite)
{
m_transaction.execute(new cmd::FlattenLayers(sprite));
}
Layer* DocumentApi::duplicateLayerAfter(Layer* sourceLayer, LayerGroup* parent, Layer* afterLayer)
{
ASSERT(parent);

View File

@ -84,7 +84,6 @@ namespace app {
void restackLayerBefore(Layer* layer, LayerGroup* parent, Layer* beforeThis);
void backgroundFromLayer(Layer* layer);
void layerFromBackground(Layer* layer);
void flattenLayers(Sprite* sprite);
Layer* duplicateLayerAfter(Layer* sourceLayer, LayerGroup* parent, Layer* afterLayer);
Layer* duplicateLayerBefore(Layer* sourceLayer, LayerGroup* parent, Layer* beforeLayer);