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:
commit
fa57cedb20
|
@ -42,6 +42,7 @@
|
|||
- [#138] New tool: 'Mirror Point' or 'Symmetric Point'.
|
||||
- [#573] New tool: 'Move Point'.
|
||||
- [#577] 10 new colors added for the lines
|
||||
- [#570] Tiled PDF : Margin values correctly taken into account
|
||||
|
||||
# Version 0.4.5 October 15, 2016
|
||||
- [#435] Valentina doesn't change the cursor.
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "../vformat/vmeasurements.h"
|
||||
#include "../vmisc/commandoptions.h"
|
||||
#include "../vmisc/vsettings.h"
|
||||
#include <QDebug>
|
||||
|
||||
VCommandLinePtr VCommandLine::instance = nullptr;
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include <QKeyEvent>
|
||||
#include <QApplication>
|
||||
#include <QColorDialog>
|
||||
#include <QDebug>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "../vpropertyexplorer/vproperty.h"
|
||||
#include "../vtools/dialogs/support/dialogeditwrongformula.h"
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
|
||||
#include <QDockWidget>
|
||||
#include <QHBoxLayout>
|
||||
#include <QDebug>
|
||||
#include <QRegularExpression>
|
||||
|
||||
using namespace VPE;
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "../vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h"
|
||||
#include "../xml/vpattern.h"
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#include <QDebug>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QProcess>
|
||||
#include <QtDebug>
|
||||
#include <QRegularExpression>
|
||||
|
||||
const QString baseFilenameRegExp = QStringLiteral("^[\\w\\-. ]+$");
|
||||
|
||||
|
|
|
@ -383,7 +383,27 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer)
|
|||
// Render
|
||||
QRectF source;
|
||||
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);
|
||||
|
||||
|
|
|
@ -55,6 +55,8 @@
|
|||
#include <QMessageBox>
|
||||
#include <QUndoStack>
|
||||
#include <QtNumeric>
|
||||
#include <QDebug>
|
||||
#include <QFileInfo>
|
||||
|
||||
const QString VPattern::AttrReadOnly = QStringLiteral("readOnly");
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <QStringData>
|
||||
#include <QStringDataPtr>
|
||||
#include <QtGlobal>
|
||||
#include <QLocale>
|
||||
|
||||
#include "../ifc/ifcdef.h"
|
||||
#include "../vmisc/def.h"
|
||||
|
|
|
@ -267,9 +267,29 @@ QRect VPoster::PageRect() const
|
|||
// we can't use method pageRect(QPrinter::Point). Our dpi value can be different.
|
||||
// We convert value yourself to pixels.
|
||||
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())));
|
||||
return pageRect;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VPoster::ToPixel(qreal val)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <QDomElement>
|
||||
#include <QPointF>
|
||||
#include <QUndoCommand>
|
||||
#include <QDebug>
|
||||
|
||||
#include "../ifc/xml/vabstractpattern.h"
|
||||
#include "../ifc/ifcdef.h"
|
||||
|
|
Loading…
Reference in New Issue
Block a user