mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Minor bugfixes
This commit is contained in:
@ -1082,7 +1082,7 @@ void PDFPageContentProcessor::operatorAdjustCurrentTransformationMatrix(PDFReal
|
|||||||
// to avoid errors later (for some operations, we assume matrix is invertible).
|
// to avoid errors later (for some operations, we assume matrix is invertible).
|
||||||
|
|
||||||
QMatrix matrix(a, b, c, d, e, f);
|
QMatrix matrix(a, b, c, d, e, f);
|
||||||
QMatrix transformMatrix = m_graphicState.getCurrentTransformationMatrix() * matrix;
|
QMatrix transformMatrix = matrix * m_graphicState.getCurrentTransformationMatrix();
|
||||||
|
|
||||||
if (!transformMatrix.isInvertible())
|
if (!transformMatrix.isInvertible())
|
||||||
{
|
{
|
||||||
@ -1574,9 +1574,7 @@ void PDFPageContentProcessor::operatorTextSetRise(PDFReal rise)
|
|||||||
void PDFPageContentProcessor::operatorTextMoveByOffset(PDFReal t_x, PDFReal t_y)
|
void PDFPageContentProcessor::operatorTextMoveByOffset(PDFReal t_x, PDFReal t_y)
|
||||||
{
|
{
|
||||||
const QMatrix& textLineMatrix = m_graphicState.getTextLineMatrix();
|
const QMatrix& textLineMatrix = m_graphicState.getTextLineMatrix();
|
||||||
|
QMatrix transformedMatrix = QMatrix(1, 0, 0, 1, t_x, t_y) * textLineMatrix;
|
||||||
QMatrix transformedMatrix = textLineMatrix;
|
|
||||||
transformedMatrix.translate(t_x, t_y);
|
|
||||||
|
|
||||||
m_graphicState.setTextMatrix(transformedMatrix);
|
m_graphicState.setTextMatrix(transformedMatrix);
|
||||||
m_graphicState.setTextLineMatrix(transformedMatrix);
|
m_graphicState.setTextLineMatrix(transformedMatrix);
|
||||||
@ -1790,7 +1788,7 @@ void PDFPageContentProcessor::drawText(const TextSequence& textSequence)
|
|||||||
const QPainterPath& glyphPath = *item.glyph;
|
const QPainterPath& glyphPath = *item.glyph;
|
||||||
if (!glyphPath.isEmpty())
|
if (!glyphPath.isEmpty())
|
||||||
{
|
{
|
||||||
QMatrix textRenderingMatrix = textMatrix * adjustMatrix;
|
QMatrix textRenderingMatrix = adjustMatrix * textMatrix;
|
||||||
QPainterPath transformedGlyph = textRenderingMatrix.map(glyphPath);
|
QPainterPath transformedGlyph = textRenderingMatrix.map(glyphPath);
|
||||||
performPathPainting(transformedGlyph, stroke, fill, transformedGlyph.fillRule());
|
performPathPainting(transformedGlyph, stroke, fill, transformedGlyph.fillRule());
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ void PDFPainter::performUpdateGraphicsState(const PDFPageContentProcessorState&
|
|||||||
// If current transformation matrix has changed, then update it
|
// If current transformation matrix has changed, then update it
|
||||||
if (flags.testFlag(PDFPageContentProcessorState::StateCurrentTransformationMatrix))
|
if (flags.testFlag(PDFPageContentProcessorState::StateCurrentTransformationMatrix))
|
||||||
{
|
{
|
||||||
m_painter->setWorldMatrix(m_pagePointToDevicePointMatrix * state.getCurrentTransformationMatrix(), false);
|
m_painter->setWorldMatrix(state.getCurrentTransformationMatrix() * m_pagePointToDevicePointMatrix, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags.testFlag(PDFPageContentProcessorState::StateStrokeColor) ||
|
if (flags.testFlag(PDFPageContentProcessorState::StateStrokeColor) ||
|
||||||
|
Reference in New Issue
Block a user