Issues

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

Issue Type: Bug Created: 2008-08-12T11:14:09.000+0000 Last Updated: 2008-12-21T06:02:26.000+0000 Status: Resolved Fix version(s): - 1.7.1 (01/Dec/08)

Reporter: Florian Gross (f.gross) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Pdf

Related issues: Attachments:

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:

<pre class="literal"> 
@@ -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

Posted by Alexander Veremyev (alexander) on 2008-11-26T10:34:37.000+0000

Fixed

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts