From 9dcdf10d1a762e2610aee4034833bdbbb8b81bec Mon Sep 17 00:00:00 2001 From: Jakub Melka Date: Sun, 14 Mar 2021 16:08:50 +0100 Subject: [PATCH] Bugfixing: Tensor product patch shading sampler --- Pdf4QtLib/sources/pdfpattern.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Pdf4QtLib/sources/pdfpattern.cpp b/Pdf4QtLib/sources/pdfpattern.cpp index 3b84ea4..42ee4f7 100644 --- a/Pdf4QtLib/sources/pdfpattern.cpp +++ b/Pdf4QtLib/sources/pdfpattern.cpp @@ -3112,7 +3112,9 @@ public: virtual bool sample(const QPointF& devicePoint, PDFColorBuffer outputBuffer, int limit) const override { constexpr PDFReal epsilon = 0.001; - std::array initialSamples = { QPointF(0.5, 0.5) }; + std::array initialSamples = { QPointF(0.5, 0.5), // Middle of the patch + QPointF(0.0, 0.0), QPointF(1.0, 0.0), QPointF(0.0, 1.0), QPointF(1.0, 1.0), // Four corners + QPointF(0.5, 0.0), QPointF(0.5, 1.0), QPointF(0.0, 0.5), QPointF(1.0, 0.5) }; // Middle point of edges for (const PDFTensorPatch& patch : m_patches) {