mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Change opacity to 255 for layers and cels on "Background from Layer"
This commit is contained in:
parent
b9af6c3b02
commit
be0a944cd8
@ -15,6 +15,7 @@
|
||||
#include "app/cmd/configure_background.h"
|
||||
#include "app/cmd/copy_rect.h"
|
||||
#include "app/cmd/replace_image.h"
|
||||
#include "app/cmd/set_cel_opacity.h"
|
||||
#include "app/cmd/set_cel_position.h"
|
||||
#include "app/document.h"
|
||||
#include "doc/cel.h"
|
||||
@ -68,6 +69,10 @@ void BackgroundFromLayer::onExecute()
|
||||
// now we have to copy the new image (bg_image) to the cel...
|
||||
executeAndAdd(new cmd::SetCelPosition(cel, 0, 0));
|
||||
|
||||
// change opacity to 255
|
||||
if (cel->opacity() < 255)
|
||||
executeAndAdd(new cmd::SetCelOpacity(cel, 255));
|
||||
|
||||
// same size of cel-image and bg-image
|
||||
if (bg_image->width() == cel_image->width() &&
|
||||
bg_image->height() == cel_image->height()) {
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "app/cmd/move_layer.h"
|
||||
#include "app/cmd/set_layer_flags.h"
|
||||
#include "app/cmd/set_layer_name.h"
|
||||
#include "app/cmd/set_layer_opacity.h"
|
||||
|
||||
namespace app {
|
||||
namespace cmd {
|
||||
@ -26,6 +27,12 @@ ConfigureBackground::ConfigureBackground(Layer* layer)
|
||||
|
||||
add(new cmd::SetLayerFlags(layer, newFlags));
|
||||
add(new cmd::SetLayerName(layer, "Background"));
|
||||
|
||||
if (layer->isImage() &&
|
||||
static_cast<LayerImage*>(layer)->opacity() < 255) {
|
||||
add(new cmd::SetLayerOpacity(static_cast<LayerImage*>(layer), 255));
|
||||
}
|
||||
|
||||
add(new cmd::MoveLayer(layer, nullptr));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user