DocumentExporter: Use transparent color to trim transparent layer (fix #622)

This commit is contained in:
David Capello 2015-04-01 17:43:31 -03:00
parent 7c3547f147
commit 8cb1892601

View File

@ -389,8 +389,12 @@ void DocumentExporter::captureSamples(Samples& samples)
gfx::Rect frameBounds;
doc::color_t refColor = 0;
if (m_trimCels)
refColor = get_pixel(sampleRender, 0, 0);
if (m_trimCels) {
if (layer->isBackground())
refColor = get_pixel(sampleRender, 0, 0);
else
refColor = sprite->transparentColor();
}
else if (m_ignoreEmptyCels)
refColor = sprite->transparentColor();