Fix texture rotation

master
Jeremy Hu 2019-11-04 07:26:30 +09:30
parent ac61cee164
commit 657d93ca99
1 changed files with 3 additions and 3 deletions

View File

@ -337,9 +337,9 @@ void TextureGenerator::generate()
rect.height() * TextureGenerator::m_textureSize
};
if (translatedRect.width() < translatedRect.height()) {
painter.drawTiledPixmap(translatedRect, rotatedPixmap);
painter.drawTiledPixmap(translatedRect, rotatedPixmap, QPointF(rect.top(), rect.left()));
} else {
painter.drawTiledPixmap(translatedRect, pixmap);
painter.drawTiledPixmap(translatedRect, pixmap, rect.topLeft());
}
}
painter.setOpacity(1.0);
@ -358,7 +358,7 @@ void TextureGenerator::generate()
QMatrix matrix;
matrix.translate(center.x(), center.y());
matrix.rotate(90);
auto rotatedImage = scaledImage.transformed(matrix);
auto rotatedImage = scaledImage.transformed(matrix).mirrored(true, false);
targetMap[it.first] = std::make_pair(QPixmap::fromImage(scaledImage),
QPixmap::fromImage(rotatedImage));
}