From d7ba96ac5b9077e698690072927f034dc35ad220 Mon Sep 17 00:00:00 2001 From: Jakub Melka Date: Mon, 8 Mar 2021 19:35:12 +0100 Subject: [PATCH] Bugfix: Axial shading sampler corrections --- Pdf4QtLib/sources/pdfpattern.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Pdf4QtLib/sources/pdfpattern.cpp b/Pdf4QtLib/sources/pdfpattern.cpp index 7e5dd17..b94fd48 100644 --- a/Pdf4QtLib/sources/pdfpattern.cpp +++ b/Pdf4QtLib/sources/pdfpattern.cpp @@ -1181,6 +1181,8 @@ public: m_tAtEnd = axialShadingPattern->getDomainEnd(); m_tMin = qMin(m_tAtStart, m_tAtEnd); m_tMax = qMax(m_tAtStart, m_tAtEnd); + + m_p1p2GCS = p1p2GCS; } virtual bool sample(const QPointF& devicePoint, PDFColorBuffer outputBuffer, int limit) const override @@ -1202,7 +1204,12 @@ public: { if (!m_axialShadingPattern->isExtendStart()) { - return fillBackgroundColor(outputBuffer); + return false; + } + + if (fillBackgroundColor(outputBuffer)) + { + return true; } t = m_tAtStart; @@ -1211,7 +1218,12 @@ public: { if (!m_axialShadingPattern->isExtendEnd()) { - return fillBackgroundColor(outputBuffer); + return false; + } + + if (fillBackgroundColor(outputBuffer)) + { + return true; } t = m_tAtEnd;