diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index d74671771..29acee427 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -328,7 +328,7 @@ void TableWindow::SvgFile(const QString &name, int i) const painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); - scenes.at(i)->render(&painter); + scenes.at(i)->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio); painter.end(); } } @@ -345,7 +345,7 @@ void TableWindow::PngFile(const QString &name, int i) const { const QRectF r = paper->rect(); // Create the image with the exact size of the shrunk scene - QImage image(QSize(static_cast(r.width()), static_cast(r.height())), QImage::Format_ARGB32); + QImage image(r.size().toSize(), QImage::Format_ARGB32); image.fill(Qt::transparent); // Start all pixels transparent QPainter painter(&image); painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); @@ -353,7 +353,7 @@ void TableWindow::PngFile(const QString &name, int i) const painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); - scenes.at(i)->render(&painter, r, r); + scenes.at(i)->render(&painter, r, r, Qt::IgnoreAspectRatio); image.save(name); } } @@ -386,7 +386,7 @@ void TableWindow::PdfFile(const QString &name, int i) const painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); - scenes.at(i)->render(&painter); + scenes.at(i)->render(&painter, r, r, Qt::IgnoreAspectRatio); painter.end(); } } @@ -462,7 +462,7 @@ void TableWindow::ObjFile(const QString &name, int i) const generator.setResolution(static_cast(qApp->PrintDPI)); QPainter painter; painter.begin(&generator); - scenes.at(i)->render(&painter); + scenes.at(i)->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio); painter.end(); } }