DocExporter: render samples with trimmed size

This fix an issue merging similar cels from different sprites with
different canvas sizes.
This commit is contained in:
David Capello 2020-02-06 14:23:33 -03:00
parent 00cdda7b85
commit a7f1f4bd64

View File

@ -250,8 +250,8 @@ public:
ImageRef render(
Image::create(m_sprite->pixelFormat(),
m_sprite->width(),
m_sprite->height(),
m_trimmedBounds.w,
m_trimmedBounds.h,
imageBuf));
render->setMaskColor(m_sprite->transparentColor());
clear_image(render.get(), m_sprite->transparentColor());
@ -272,7 +272,7 @@ public:
//render.setNewBlend(Preferences::instance().experimental.newBlend());
if (extrude) {
const gfx::Rect& trim = trimmedBounds();
const gfx::Rect& trim = m_trimmedBounds;
// Displaced position onto the destination texture
int dx[] = { 0, 1, trim.w+1 };
@ -298,7 +298,7 @@ public:
}
}
else {
gfx::Clip clip(x, y, trimmedBounds());
gfx::Clip clip(x, y, m_trimmedBounds);
render.renderSprite(dst, m_sprite, m_frame, clip);
}
}