[cairo-bugs] [Bug 101763] Bezier curve with matching start/end and control points is not rendered correctly

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jul 15 07:37:18 UTC 2017


--- Comment #4 from Uli Schlachter <psychon at znc.in> ---
What happens is:
_cairo_path_fixed_stroke_to_polygon is called and in its curve_to() callback it
calls _cairo_spline_decompose() on this curve.
The original curve is (100,100)->(200,200)->(200,200)->(100,100) (these are its
four control points) and it is decomposed into the following two curves:

The error now is 0 so points are added. The add_point callback of the spline is
spline_to() and it gets the following arguments:
spline to (175,175) with tangent (0,0)
spline to (100,100) with tangent (-100,-100)

The problem is the tangent (0,0), which means that spline_to() just calls
add_fan(). At this point I am lost on what is going on. This code ignores the
point argument and only uses the passed-in point. Thus, only "things around
(100,100)" happen.

With the following patch, things work as expected. Since I have no clue about
the algorithm, I'm not sure how incorrect this is. I guess that the thought
here was "tangent (0,0) can only happen if the points are all the same", which
this example shows is wrong. However, since this is just a guess, I'll hope
that someone with more of a clue looks at this. Oh and: The test suite should
be checked for regressions.

Anyone with some clue about this?

You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo-bugs/attachments/20170715/18f48750/attachment.html>

More information about the cairo-bugs mailing list