You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is running on Python 3.8.1 on Windows 7 with Pycairo 1.23.0.
I suspect this has something to do with how the middle segment is approximately linear (two of the tangent points are almost exactly coincident with their corresponding positional points) but I don't really know. Any help appreciated!
The text was updated successfully, but these errors were encountered:
Tried to minimize this a bit. Dunno if this is much better than the original. I guess cairo-the-C-library has some kind of over/underflow somewhere.
importcairo, ctypes, mathdefmain():
width, height=600, 600surface=cairo.ImageSurface(cairo.FORMAT_RGB24, width, height)
context=cairo.Context(surface)
context.scale(100, 100)
# The actual curve that breakscontext.curve_to(4.82529145, 3.88868164,
1.92531232, 3.88878525,
1.92536413, 3.88888889)
# Just for comparison, a "proper" line with this line widthifFalse:
context.rel_line_to(0, -1)
context.set_line_width(0.1)
context.set_source_rgb(1,1,1)
context.stroke()
# Show the control points for the curveifFalse:
fori, (x, y) inenumerate(
[(4.82529145, 3.88868164),
(1.92531232, 3.88878525),
(1.92536413, 3.88888889)]):
color= [0, 0, 0, 0.5]
color[i] =1context.set_source_rgba(*color)
context.arc(x, y, 0.05, 0, 2*math.pi)
context.fill()
context.get_target().write_to_png("bug.png")
main()
Pycairo seems to be incorrectly rendering certain cubic Bezier splines. The joins are incorrect and the line width changes.
Here is the code to reproduce the effect:
This is running on Python 3.8.1 on Windows 7 with Pycairo 1.23.0.
I suspect this has something to do with how the middle segment is approximately linear (two of the tangent points are almost exactly coincident with their corresponding positional points) but I don't really know. Any help appreciated!
The text was updated successfully, but these errors were encountered: