mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-24 09:02:31 +00:00
Remove bgcolor param from DocumentApi::backgroundFromLayer()
This commit is contained in:
parent
972b2f8ff7
commit
4e6e50194e
@ -20,7 +20,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "app/color_utils.h"
|
|
||||||
#include "app/commands/command.h"
|
#include "app/commands/command.h"
|
||||||
#include "app/context_access.h"
|
#include "app/context_access.h"
|
||||||
#include "app/document_api.h"
|
#include "app/document_api.h"
|
||||||
@ -68,19 +67,10 @@ void BackgroundFromLayerCommand::onExecute(Context* context)
|
|||||||
Document* document(writer.document());
|
Document* document(writer.document());
|
||||||
Sprite* sprite(writer.sprite());
|
Sprite* sprite(writer.sprite());
|
||||||
|
|
||||||
raster::color_t bgcolor =
|
|
||||||
color_utils::color_for_target(
|
|
||||||
context->settings()->getBgColor(),
|
|
||||||
ColorTarget(
|
|
||||||
ColorTarget::BackgroundLayer,
|
|
||||||
sprite->pixelFormat(),
|
|
||||||
sprite->transparentColor()));
|
|
||||||
|
|
||||||
{
|
{
|
||||||
UndoTransaction undo_transaction(writer.context(), "Background from Layer");
|
UndoTransaction undo_transaction(writer.context(), "Background from Layer");
|
||||||
document->getApi().backgroundFromLayer(
|
document->getApi().backgroundFromLayer(
|
||||||
static_cast<LayerImage*>(writer.layer()),
|
static_cast<LayerImage*>(writer.layer()));
|
||||||
bgcolor);
|
|
||||||
undo_transaction.commit();
|
undo_transaction.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,7 +950,7 @@ void DocumentApi::displaceLayers(Layer* layer, int dx, int dy)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentApi::backgroundFromLayer(LayerImage* layer, color_t bgcolor)
|
void DocumentApi::backgroundFromLayer(LayerImage* layer)
|
||||||
{
|
{
|
||||||
ASSERT(layer);
|
ASSERT(layer);
|
||||||
ASSERT(layer->isImage());
|
ASSERT(layer->isImage());
|
||||||
@ -960,6 +960,7 @@ void DocumentApi::backgroundFromLayer(LayerImage* layer, color_t bgcolor)
|
|||||||
ASSERT(layer->sprite()->backgroundLayer() == NULL);
|
ASSERT(layer->sprite()->backgroundLayer() == NULL);
|
||||||
|
|
||||||
Sprite* sprite = layer->sprite();
|
Sprite* sprite = layer->sprite();
|
||||||
|
color_t bgcolor = bgColor();
|
||||||
|
|
||||||
// create a temporary image to draw each frame of the new
|
// create a temporary image to draw each frame of the new
|
||||||
// `Background' layer
|
// `Background' layer
|
||||||
@ -980,8 +981,7 @@ void DocumentApi::backgroundFromLayer(LayerImage* layer, color_t bgcolor)
|
|||||||
|
|
||||||
clear_image(bg_image, bgcolor);
|
clear_image(bg_image, bgcolor);
|
||||||
composite_image(bg_image, cel_image,
|
composite_image(bg_image, cel_image,
|
||||||
cel->x(),
|
cel->x(), cel->y(),
|
||||||
cel->y(),
|
|
||||||
MID(0, cel->opacity(), 255),
|
MID(0, cel->opacity(), 255),
|
||||||
layer->getBlendMode());
|
layer->getBlendMode());
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ namespace app {
|
|||||||
void restackLayerBefore(Layer* layer, Layer* beforeThis);
|
void restackLayerBefore(Layer* layer, Layer* beforeThis);
|
||||||
void cropLayer(Layer* layer, int x, int y, int w, int h, color_t bgcolor);
|
void cropLayer(Layer* layer, int x, int y, int w, int h, color_t bgcolor);
|
||||||
void displaceLayers(Layer* layer, int dx, int dy);
|
void displaceLayers(Layer* layer, int dx, int dy);
|
||||||
void backgroundFromLayer(LayerImage* layer, color_t bgcolor);
|
void backgroundFromLayer(LayerImage* layer);
|
||||||
void layerFromBackground(Layer* layer);
|
void layerFromBackground(Layer* layer);
|
||||||
void flattenLayers(Sprite* sprite, color_t bgcolor);
|
void flattenLayers(Sprite* sprite, color_t bgcolor);
|
||||||
void duplicateLayerAfter(Layer* sourceLayer, Layer* afterLayer);
|
void duplicateLayerAfter(Layer* sourceLayer, Layer* afterLayer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user