Code

Fixed a typo and an off-by-one error
authormiklosh <miklosh@users.sourceforge.net>
Sun, 19 Aug 2007 12:20:35 +0000 (12:20 +0000)
committermiklosh <miklosh@users.sourceforge.net>
Sun, 19 Aug 2007 12:20:35 +0000 (12:20 +0000)
src/extension/internal/pdfinput/pdf-parser.cpp

index 121e6aa471b54d265508ff6929c7b3b012039913..948f0efaaf1b814042de3cd4fdaa09d5fea07b80 100644 (file)
@@ -1850,7 +1850,7 @@ void PdfParser::fillPatch(GfxPatch *patch, int nComps, int depth) {
       break;
     }
   }
-  if (i == nComps || depth == maxDepths[pdfPatchMeshShading]-1) {
+  if (i == nComps || depth == maxDepths[pdfPatchMeshShading-1]) {
     state->setFillColor(&patch->color[0][0]);
     state->moveTo(patch->x[0][0], patch->y[0][0]);
     state->curveTo(patch->x[0][1], patch->y[0][1],
@@ -3034,7 +3034,7 @@ void PdfParser::popResources() {
 void PdfParser::setDefaultApproximationPrecision() {
   int i;
 
-  for (i = 0; i < pdfNumShadingTypes; ++i) {
+  for (i = 1; i <= pdfNumShadingTypes; ++i) {
     setApproximationPrecision(i, defaultShadingColorDelta, defaultShadingMaxDepth);
   }
 }