Don't use the ColorBar bg color when Background is visible in Flatten

This commit is contained in:
David Capello 2015-07-27 08:34:05 -03:00
parent 64ae80f0d3
commit 0f38a7dace

View File

@ -45,15 +45,22 @@ void FlattenLayers::onExecute()
// If there aren't a background layer we must to create the background. // If there aren't a background layer we must to create the background.
LayerImage* background = sprite->backgroundLayer(); LayerImage* background = sprite->backgroundLayer();
bool created = false;
if (!background) { if (!background) {
background = new LayerImage(sprite); background = new LayerImage(sprite);
executeAndAdd(new cmd::AddLayer(sprite->folder(), background, nullptr)); executeAndAdd(new cmd::AddLayer(sprite->folder(), background, nullptr));
executeAndAdd(new cmd::ConfigureBackground(background)); executeAndAdd(new cmd::ConfigureBackground(background));
created = true;
} }
color_t bgcolor;
if (created || !background->isVisible())
bgcolor = doc->bgColor(background); // Use color bar background color
else
bgcolor = sprite->transparentColor();
render::Render render; render::Render render;
render.setBgType(render::BgType::NONE); render.setBgType(render::BgType::NONE);
color_t bgcolor = doc->bgColor(background);
// Copy all frames to the background. // Copy all frames to the background.
for (frame_t frame(0); frame<sprite->totalFrames(); ++frame) { for (frame_t frame(0); frame<sprite->totalFrames(); ++frame) {