-
Notifications
You must be signed in to change notification settings - Fork 92
Closed
Description
The sample Python code below draws this on a Mac using pycairo 1.20.1 and cairo 1.16.0 (installed via Homebrew):
On Windows using pycairo 1.20.0 and 1.20.1 (installed via pip using the Windows wheel), it draws this:
import cairo
WIDTH, HEIGHT = 400, 400
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT)
ctx = cairo.Context(surface)
ctx.scale(WIDTH, HEIGHT)
points = [[200, 100], [222.45139882897308, 169.09830056251377], [295.10565162951536, 169.09830056250527], [236.32712640025804, 211.80339887498624], [258.7785252292473, 280.90169943749476], [200.0, 238.196601125], [141.22147477075268, 280.9016994374947], [163.67287359974196, 211.80339887498624], [104.89434837048466, 169.09830056250522], [177.54860117102692, 169.09830056251377]]
ctx.new_path()
ctx.move_to(points[0][0] / WIDTH, points[0][1] / HEIGHT)
for point in points[1:]:
ctx.line_to(point[0] / WIDTH, point[1] / HEIGHT)
ctx.close_path()
ctx.set_source_rgb(1, 0 ,0)
ctx.fill_preserve()
ctx.clip_preserve()
ctx.set_source_rgb(0, 1, 0)
ctx.set_line_width(.05)
ctx.stroke()
surface.write_to_png("example.png")Any ideas what might be causing this? Let me know if I can provide any more information that would be helpful.
Metadata
Metadata
Assignees
Labels
No labels

