Forum Bugs

SVG clip path - Inaccurate clipping

mparento
My HTML file has a complex path clipped with a simple rectangular path, using clipPathUnits="objectBoundingBox". In the resulting PDF, the clipped area is larger than in the original HTML file. The difference is important enough to be a problem.

In the attached sample file, a red div is displayed to make the comparison easier. The HTML file is somewhat large due to the complex path (which may not be needed to reproduce the bug but I kept the actual path for which I observed the problem).
  1. svg-clip-path.html235.2 kB
    HTML source file
  2. svg-clip-path.pdf68.5 kB
    Converted PDF file
wangp
Thanks for the test case. The problem is that the calculation of the bounding box of a path containing a Bézier curve segment currently uses the control points as an approximation instead of the true extents of the curve. We will fix this.
mikeday
We have released a latest build with a fix for this, thanks for letting us know about the issue! :D