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