Fix bug introduced in a2cbf3f285: trim transparent layers correctly

This commit is contained in:
David Capello 2015-04-30 17:04:11 -03:00
parent b519901cef
commit 91bacca270

View File

@ -402,8 +402,11 @@ void DocumentExporter::captureSamples(Samples& samples)
doc::color_t refColor = 0;
if (m_trimCels) {
if (sprite->backgroundLayer() &&
sprite->backgroundLayer()->isVisible()) {
if ((layer &&
layer->isBackground()) ||
(!layer &&
sprite->backgroundLayer() &&
sprite->backgroundLayer()->isVisible())) {
refColor = get_pixel(sampleRender, 0, 0);
}
else {