Commit 59e57fea authored by Michael Winkelmann's avatar Michael Winkelmann

Fix rectangle for custom items

parent 725685e2
...@@ -133,13 +133,10 @@ void QmlPrinter::paintItem(QQuickItem *item, QQuickWindow *window, ...@@ -133,13 +133,10 @@ void QmlPrinter::paintItem(QQuickItem *item, QQuickWindow *window,
paintQQuickCanvasItem(item, window, painter); paintQQuickCanvasItem(item, window, painter);
} else { } else {
// Fallback to screen capture if we are unable to parse the data // Fallback to screen capture if we are unable to parse the data
QRect rect = item->mapRectFromScene(item->boundingRect()).toRect(); QRectF rect(0,0,item->width(),item->height());
if (window != nullptr) { if (window != nullptr) {
QImage image = window->grabWindow(); QImage image = window->grabWindow();
painter->drawImage(rect, image, rect);
painter->drawImage(
rect, image,
QRect(rect.x(), rect.y(), rect.width(), rect.height()));
} }
drawChildren = false; drawChildren = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment