fix: now always copy original pixmap

This commit is contained in:
Gary Wang 2021-07-06 13:25:53 +08:00
parent a400dcaeb1
commit 6b2db55b84

View File

@ -109,6 +109,11 @@ bool GraphicsScene::trySetTransformationMode(Qt::TransformationMode mode, float
QPixmap GraphicsScene::renderToPixmap() QPixmap GraphicsScene::renderToPixmap()
{ {
PGraphicsPixmapItem * pixmapItem = qgraphicsitem_cast<PGraphicsPixmapItem *>(m_theThing);
if (pixmapItem) {
return pixmapItem->pixmap();
}
QPixmap pixmap(sceneRect().toRect().size()); QPixmap pixmap(sceneRect().toRect().size());
pixmap.fill(Qt::transparent); pixmap.fill(Qt::transparent);
QPainter p(&pixmap); QPainter p(&pixmap);