1
0

fix: use SmoothTransformation when scale factor less than 100%

This commit is contained in:
Gary Wang
2020-02-13 19:45:14 +08:00
parent 8fe860e4bf
commit f49ed645fc
4 changed files with 25 additions and 0 deletions

View File

@@ -60,6 +60,17 @@ void GraphicsScene::showGif(const QString &filepath)
this->setSceneRect(m_theThing->boundingRect());
}
bool GraphicsScene::trySetTransformationMode(Qt::TransformationMode mode)
{
QGraphicsPixmapItem * pixmapItem = qgraphicsitem_cast<QGraphicsPixmapItem *>(m_theThing);
if (pixmapItem) {
pixmapItem->setTransformationMode(mode);
return true;
}
return false;
}
QPixmap GraphicsScene::renderToPixmap()
{
QPixmap pixmap(sceneRect().toRect().size());