fix wrong size svg export page

This commit is contained in:
WandererFan
2017-03-31 15:21:00 -04:00
committed by wmayer
parent 15dac7a32c
commit 219f126674
2 changed files with 2 additions and 5 deletions

View File

@@ -558,6 +558,7 @@ void QGVPage::toggleHatch(bool enable)
void QGVPage::saveSvg(QString filename)
{
// TODO: We only have m_vpPage because constructor gets passed a view provider...
//NOTE: this makes wrong size pages in low-Rez
TechDraw::DrawPage *page( m_vpPage->getDrawPage() );
const QString docName( QString::fromUtf8(page->getDocument()->getName()) );
@@ -567,11 +568,7 @@ void QGVPage::saveSvg(QString filename)
tr(" exported from FreeCAD document: ") +
docName;
//Base::Console().Message("TRACE - saveSVG - page width: %d height: %d\n",width,height); //A4 297x210
//with Rez set to 10 we make a dot 10 times/mm => 254dpi?
// 12 => 304.8 dpi? approx printer dpi 300dpi
QSvgGenerator svgGen;
svgGen.setFileName(filename);
svgGen.setSize(QSize((int) Rez::guiX(page->getPageWidth()), (int) Rez::guiX(page->getPageHeight()))); //expects pixels, gets mm

View File

@@ -125,7 +125,7 @@ double Rez::getParameter()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Rez");
double rezFactor = hGrp->GetFloat("Resolution", 1.0);
double rezFactor = hGrp->GetFloat("Resolution", 10.0);
return rezFactor;
}