mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #69: Dashed Line not rendered as expected
This commit is contained in:
@ -911,8 +911,7 @@ void PDFPageContentProcessor::processPathPainting(const QPainterPath& path, bool
|
||||
const PDFLineDashPattern& lineDashPattern = m_graphicState.getLineDashPattern();
|
||||
if (!lineDashPattern.isSolid())
|
||||
{
|
||||
const auto& dashArray = lineDashPattern.getDashArray();
|
||||
stroker.setDashPattern(QVector<PDFReal>(dashArray.begin(), dashArray.end()));
|
||||
stroker.setDashPattern(lineDashPattern.createForQPen(m_graphicState.getLineWidth()));
|
||||
stroker.setDashOffset(lineDashPattern.getDashOffset());
|
||||
}
|
||||
QPainterPath strokedPath = stroker.createStroke(path);
|
||||
@ -959,8 +958,7 @@ void PDFPageContentProcessor::processPathPainting(const QPainterPath& path, bool
|
||||
const PDFLineDashPattern& lineDashPattern = m_graphicState.getLineDashPattern();
|
||||
if (!lineDashPattern.isSolid())
|
||||
{
|
||||
const auto& dashArray = lineDashPattern.getDashArray();
|
||||
stroker.setDashPattern(QVector<PDFReal>(dashArray.begin(), dashArray.end()));
|
||||
stroker.setDashPattern(lineDashPattern.createForQPen(m_graphicState.getLineWidth()));
|
||||
stroker.setDashOffset(lineDashPattern.getDashOffset());
|
||||
}
|
||||
QPainterPath strokedPath = stroker.createStroke(path);
|
||||
@ -3978,6 +3976,18 @@ void PDFLineDashPattern::fix()
|
||||
}
|
||||
}
|
||||
|
||||
QVector<qreal> PDFLineDashPattern::createForQPen(qreal penWidthF) const
|
||||
{
|
||||
QVector<qreal> lineDashPattern(m_dashArray.begin(), m_dashArray.end());
|
||||
|
||||
for (qreal& value : lineDashPattern)
|
||||
{
|
||||
value /= penWidthF;
|
||||
}
|
||||
|
||||
return lineDashPattern;
|
||||
}
|
||||
|
||||
PDFPageContentProcessor::PDFSoftMaskDefinition PDFPageContentProcessor::PDFSoftMaskDefinition::parse(const PDFDictionary* softMask, PDFPageContentProcessor* processor)
|
||||
{
|
||||
PDFSoftMaskDefinition result;
|
||||
|
Reference in New Issue
Block a user