[poppler] Branch 'poppler-0.10' - poppler/Gfx.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun May 10 14:40:48 PDT 2009


 poppler/Gfx.cc |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit a69d40832f581a8a3c7fbf44b50051668be61814
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date:   Sun May 10 23:39:11 2009 +0200

    Fix axial shading fix to ensure the painting passes by the four edges of the bbox
    
    When j and teoricalj are the same, just change the value of ta[] not the next[] ones

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index c28aa1b..fb623f9 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -26,6 +26,7 @@
 // Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk at gmail.com>
 // Copyright (C) 2008 Pino Toscano <pino at kde.org>
 // Copyright (C) 2008 Michael Vrable <mvrable at cs.ucsd.edu>
+// Copyright (C) 2009 M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -2446,9 +2447,13 @@ void Gfx::doAxialShFill(GfxAxialShading *shading) {
          if (!doneBBox1 && ta[i] < bboxIntersections[1] && ta[j] > bboxIntersections[1]) {
            int teoricalj = (bboxIntersections[1] - tMin) * axialMaxSplits / (tMax - tMin);
            if (teoricalj <= i) teoricalj = i + 1;
-           if (j == teoricalj) j = teoricalj + 1;
-           next[i] = teoricalj;
-           next[teoricalj] = j;
+           if (teoricalj < j) {
+             next[i] = teoricalj;
+             next[teoricalj] = j;
+           }
+           else {
+             teoricalj = j;
+           }
            ta[teoricalj] = bboxIntersections[1];
            j = teoricalj;
            doneBBox1 = true;
@@ -2456,14 +2461,18 @@ void Gfx::doAxialShFill(GfxAxialShading *shading) {
          if (!doneBBox2 && ta[i] < bboxIntersections[2] && ta[j] > bboxIntersections[2]) {
            int teoricalj = (bboxIntersections[2] - tMin) * axialMaxSplits / (tMax - tMin);
            if (teoricalj <= i) teoricalj = i + 1;
-           if (j == teoricalj) j = teoricalj + 1;
-           next[i] = teoricalj;
-           next[teoricalj] = j;
+           if (teoricalj < j) {
+             next[i] = teoricalj;
+             next[teoricalj] = j;
+           }
+           else {
+             teoricalj = j;
+           }
            ta[teoricalj] = bboxIntersections[2];
            j = teoricalj;
            doneBBox2 = true;
          }
-        break;
+         break;
       }
       k = (i + j) / 2;
       ta[k] = 0.5 * (ta[i] + ta[j]);


More information about the poppler mailing list