ZF-3932: clipPolygon() and clipRectangle() in Zend_Pdf_Page don't work

Description

clipPolygon() and clipRectangle() in Zend_Pdf_Page don't seem to work.

I think this is because they are missing the "n" command which is present in clipEllipse().

This trivial fix worked fine for me:

 
@@ -913,10 +913,10 @@
         $this->_contents .= $path;
 
         if ($fillMethod == Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING) {
-            $this->_contents .= " h\n W\n";
+            $this->_contents .= "h\nW\nn\n";
         } else {
             // Even-Odd fill method.
-            $this->_contents .= " h\n W*\n";
+            $this->_contents .= "h\nW*\nn\n";
         }
     }
 
@@ -939,7 +950,7 @@
 
         $this->_contents .= $x1Obj->toString() . ' ' . $y1Obj->toString() . ' '
                          .      $widthObj->toString() . ' ' . $height2Obj->toString() . " re\n"
-                         .  " W\n";
+                         .  " W\nn\n";
     }
 
     /**

Comments

Fixed