Fix tileset image export on exact multiple of 16 tiles
This commit is contained in:
parent
62a42d6b3c
commit
67f8b09c6e
1 changed files with 2 additions and 2 deletions
|
@ -200,7 +200,7 @@ QImage TilesetEditorTileSelector::buildPrimaryTilesIndexedImage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int primaryLength = this->primaryTileset->tiles->length();
|
int primaryLength = this->primaryTileset->tiles->length();
|
||||||
int height = primaryLength / this->numTilesWide + 1;
|
int height = qCeil(primaryLength / static_cast<double>(this->numTilesWide));
|
||||||
QImage image(this->numTilesWide * 8, height * 8, QImage::Format_RGBA8888);
|
QImage image(this->numTilesWide * 8, height * 8, QImage::Format_RGBA8888);
|
||||||
|
|
||||||
QPainter painter(&image);
|
QPainter painter(&image);
|
||||||
|
@ -236,7 +236,7 @@ QImage TilesetEditorTileSelector::buildSecondaryTilesIndexedImage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int secondaryLength = this->secondaryTileset->tiles->length();
|
int secondaryLength = this->secondaryTileset->tiles->length();
|
||||||
int height = secondaryLength / this->numTilesWide + 1;
|
int height = qCeil(secondaryLength / static_cast<double>(this->numTilesWide));
|
||||||
QImage image(this->numTilesWide * 8, height * 8, QImage::Format_RGBA8888);
|
QImage image(this->numTilesWide * 8, height * 8, QImage::Format_RGBA8888);
|
||||||
|
|
||||||
QPainter painter(&image);
|
QPainter painter(&image);
|
||||||
|
|
Loading…
Reference in a new issue