Merged in ronanletiec/valentina/feature (pull request #145)

Resolved issue #570. Error: Tiled PDF : field values not taken into account if one of them is smaller than 0,3.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-10-23 09:27:58 +00:00
commit fa57cedb20
11 changed files with 55 additions and 3 deletions

View File

@ -42,6 +42,7 @@
- [#138] New tool: 'Mirror Point' or 'Symmetric Point'. - [#138] New tool: 'Mirror Point' or 'Symmetric Point'.
- [#573] New tool: 'Move Point'. - [#573] New tool: 'Move Point'.
- [#577] 10 new colors added for the lines - [#577] 10 new colors added for the lines
- [#570] Tiled PDF : Margin values correctly taken into account
# Version 0.4.5 October 15, 2016 # Version 0.4.5 October 15, 2016
- [#435] Valentina doesn't change the cursor. - [#435] Valentina doesn't change the cursor.

View File

@ -33,6 +33,7 @@
#include "../vformat/vmeasurements.h" #include "../vformat/vmeasurements.h"
#include "../vmisc/commandoptions.h" #include "../vmisc/commandoptions.h"
#include "../vmisc/vsettings.h" #include "../vmisc/vsettings.h"
#include <QDebug>
VCommandLinePtr VCommandLine::instance = nullptr; VCommandLinePtr VCommandLine::instance = nullptr;

View File

@ -33,6 +33,8 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <QApplication> #include <QApplication>
#include <QColorDialog> #include <QColorDialog>
#include <QDebug>
#include <QRegularExpression>
#include "../vpropertyexplorer/vproperty.h" #include "../vpropertyexplorer/vproperty.h"
#include "../vtools/dialogs/support/dialogeditwrongformula.h" #include "../vtools/dialogs/support/dialogeditwrongformula.h"

View File

@ -40,6 +40,8 @@
#include <QDockWidget> #include <QDockWidget>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QDebug>
#include <QRegularExpression>
using namespace VPE; using namespace VPE;

View File

@ -39,6 +39,7 @@
#include "../vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h" #include "../vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h"
#include "../xml/vpattern.h" #include "../xml/vpattern.h"
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include <QDebug>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**

View File

@ -38,6 +38,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QProcess> #include <QProcess>
#include <QtDebug> #include <QtDebug>
#include <QRegularExpression>
const QString baseFilenameRegExp = QStringLiteral("^[\\w\\-. ]+$"); const QString baseFilenameRegExp = QStringLiteral("^[\\w\\-. ]+$");

View File

@ -383,7 +383,27 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer)
// Render // Render
QRectF source; QRectF source;
isTiled ? source = poster->at(index).rect : source = paper->rect(); isTiled ? source = poster->at(index).rect : source = paper->rect();
QRectF target(0, 0, source.width() * scale, source.height() * scale);
qreal x,y;
if(printer->fullPage())
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
QMarginsF printerMargins = printer->pageLayout().margins();
x = qFloor(ToPixel(printerMargins.left(),Unit::Mm));
y = qFloor(ToPixel(printerMargins.top(),Unit::Mm));
#else
qreal left = 0, top = 0, right = 0, bottom = 0;
printer->getPageMargins(&left, &top, &right, &bottom, QPrinter::Millimeter);
x = qFloor(ToPixel(left,Unit::Mm));
y = qFloor(ToPixel(top,Unit::Mm));
#endif
}
else
{
x = 0; y = 0;
}
QRectF target(x * scale, y * scale, source.width() * scale, source.height() * scale);
scenes.at(paperIndex)->render(&painter, target, source, Qt::IgnoreAspectRatio); scenes.at(paperIndex)->render(&painter, target, source, Qt::IgnoreAspectRatio);

View File

@ -55,6 +55,8 @@
#include <QMessageBox> #include <QMessageBox>
#include <QUndoStack> #include <QUndoStack>
#include <QtNumeric> #include <QtNumeric>
#include <QDebug>
#include <QFileInfo>
const QString VPattern::AttrReadOnly = QStringLiteral("readOnly"); const QString VPattern::AttrReadOnly = QStringLiteral("readOnly");

View File

@ -40,6 +40,7 @@
#include <QStringData> #include <QStringData>
#include <QStringDataPtr> #include <QStringDataPtr>
#include <QtGlobal> #include <QtGlobal>
#include <QLocale>
#include "../ifc/ifcdef.h" #include "../ifc/ifcdef.h"
#include "../vmisc/def.h" #include "../vmisc/def.h"

View File

@ -267,9 +267,29 @@ QRect VPoster::PageRect() const
// we can't use method pageRect(QPrinter::Point). Our dpi value can be different. // we can't use method pageRect(QPrinter::Point). Our dpi value can be different.
// We convert value yourself to pixels. // We convert value yourself to pixels.
const QRectF rect = printer->pageRect(QPrinter::Millimeter); const QRectF rect = printer->pageRect(QPrinter::Millimeter);
if(printer->fullPage())
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
QMarginsF pMargins = printer->pageLayout().margins();
QRectF newRect = rect.marginsRemoved(pMargins);
const QRect pageRectFP(0, 0, qFloor(ToPixel(newRect.width())), qFloor(ToPixel(newRect.height())));
return pageRectFP;
#else
qreal left = 0 , top = 0, right = 0, bottom = 0;
printer->getPageMargins(&left, &top, &right, &bottom, QPrinter::Millimeter);
qreal newWidth = rect.width()-left-right;
qreal newHeight = rect.height()-top-bottom;
const QRect pageRectFP(0, 0, qFloor(ToPixel(newWidth)), qFloor(ToPixel(newHeight)));
return pageRectFP;
#endif
}
else
{
const QRect pageRect(0, 0, qFloor(ToPixel(rect.width())), qFloor(ToPixel(rect.height()))); const QRect pageRect(0, 0, qFloor(ToPixel(rect.width())), qFloor(ToPixel(rect.height())));
return pageRect; return pageRect;
} }
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
qreal VPoster::ToPixel(qreal val) qreal VPoster::ToPixel(qreal val)

View File

@ -31,6 +31,7 @@
#include <QDomElement> #include <QDomElement>
#include <QPointF> #include <QPointF>
#include <QUndoCommand> #include <QUndoCommand>
#include <QDebug>
#include "../ifc/xml/vabstractpattern.h" #include "../ifc/xml/vabstractpattern.h"
#include "../ifc/ifcdef.h" #include "../ifc/ifcdef.h"