Fixed issue #297. Scaling Error - Print.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2015-05-20 20:37:16 +03:00
parent 796cd7079e
commit 1e1488e290

View File

@ -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, painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()), Qt::SolidLine, Qt::RoundCap,
Qt::RoundJoin)); Qt::RoundJoin));
painter.setBrush ( QBrush ( Qt::NoBrush ) ); painter.setBrush ( QBrush ( Qt::NoBrush ) );
scenes.at(i)->render(&painter); scenes.at(i)->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio);
painter.end(); painter.end();
} }
} }
@ -345,7 +345,7 @@ void TableWindow::PngFile(const QString &name, int i) const
{ {
const QRectF r = paper->rect(); const QRectF r = paper->rect();
// Create the image with the exact size of the shrunk scene // Create the image with the exact size of the shrunk scene
QImage image(QSize(static_cast<qint32>(r.width()), static_cast<qint32>(r.height())), QImage::Format_ARGB32); QImage image(r.size().toSize(), QImage::Format_ARGB32);
image.fill(Qt::transparent); // Start all pixels transparent image.fill(Qt::transparent); // Start all pixels transparent
QPainter painter(&image); QPainter painter(&image);
painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); 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, painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap,
Qt::RoundJoin)); Qt::RoundJoin));
painter.setBrush ( QBrush ( Qt::NoBrush ) ); painter.setBrush ( QBrush ( Qt::NoBrush ) );
scenes.at(i)->render(&painter, r, r); scenes.at(i)->render(&painter, r, r, Qt::IgnoreAspectRatio);
image.save(name); 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, painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap,
Qt::RoundJoin)); Qt::RoundJoin));
painter.setBrush ( QBrush ( Qt::NoBrush ) ); painter.setBrush ( QBrush ( Qt::NoBrush ) );
scenes.at(i)->render(&painter); scenes.at(i)->render(&painter, r, r, Qt::IgnoreAspectRatio);
painter.end(); painter.end();
} }
} }
@ -462,7 +462,7 @@ void TableWindow::ObjFile(const QString &name, int i) const
generator.setResolution(static_cast<int>(qApp->PrintDPI)); generator.setResolution(static_cast<int>(qApp->PrintDPI));
QPainter painter; QPainter painter;
painter.begin(&generator); painter.begin(&generator);
scenes.at(i)->render(&painter); scenes.at(i)->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio);
painter.end(); painter.end();
} }
} }