Minor change in DocExporter

This commit is contained in:
David Capello 2020-02-06 12:01:29 -03:00
parent 1c39d907cb
commit 00cdda7b85

View File

@ -944,6 +944,7 @@ void DocExporter::captureSamples(Samples& samples,
ASSERT(done || (!done && tag)); ASSERT(done || (!done && tag));
} }
bool alreadyTrimmed = false;
if (!done && (m_ignoreEmptyCels || m_trimCels)) { if (!done && (m_ignoreEmptyCels || m_trimCels)) {
// Ignore empty cels // Ignore empty cels
if (layer && layer->isImage() && !cel && m_ignoreEmptyCels) if (layer && layer->isImage() && !cel && m_ignoreEmptyCels)
@ -1007,11 +1008,10 @@ void DocExporter::captureSamples(Samples& samples,
frameBounds = gfx::Rect(posTopLeft, posBottomRight); frameBounds = gfx::Rect(posTopLeft, posBottomRight);
} }
sample.setTrimmedBounds(frameBounds); sample.setTrimmedBounds(frameBounds);
alreadyTrimmed = true;
} }
else if (m_trimSprite)
sample.setTrimmedBounds(spriteBounds);
} }
else if (m_trimSprite) if (!alreadyTrimmed && m_trimSprite)
sample.setTrimmedBounds(spriteBounds); sample.setTrimmedBounds(spriteBounds);
samples.addSample(sample); samples.addSample(sample);