mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-27 03:16:58 +00:00
Fix bug with Export Sprite Sheet when the cel is bigger than the sprite's size.
This commit is contained in:
parent
57d5748cfe
commit
3835af7ff0
@ -140,13 +140,18 @@ protected:
|
||||
int sheet_w = sprite->getWidth()*columns;
|
||||
int sheet_h = sprite->getHeight()*((nframes/columns)+((nframes%columns)>0?1:0));
|
||||
UniquePtr<Image> resultImage(Image::create(sprite->getPixelFormat(), sheet_w, sheet_h));
|
||||
UniquePtr<Image> tempImage(Image::create(sprite->getPixelFormat(), sprite->getWidth(), sprite->getHeight()));
|
||||
image_clear(resultImage, 0);
|
||||
|
||||
int oldFrame = sprite->getCurrentFrame();
|
||||
int column = 0, row = 0;
|
||||
for (int frame=0; frame<nframes; ++frame) {
|
||||
// TODO "tempImage" could not be necessary if we could specify
|
||||
// destination clipping bounds in Sprite::render() function.
|
||||
tempImage->clear(0);
|
||||
sprite->setCurrentFrame(frame);
|
||||
sprite->render(resultImage, column*sprite->getWidth(), row*sprite->getHeight());
|
||||
sprite->render(tempImage, 0, 0);
|
||||
resultImage->copy(tempImage, column*sprite->getWidth(), row*sprite->getHeight());
|
||||
|
||||
if (++column >= columns) {
|
||||
column = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user