drawing.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:neferset 作者: andburn 项目源码 文件源码
def crosshair(ctx, x, y, length, color=None):
    if not color:
        color = (1, 0, 0)
    ctx.save()
    ctx.set_source_rgb(*color)
    ctx.set_line_width(2.0)
    ctx.set_line_cap(cairo.LINE_CAP_BUTT)
    ctx.new_path()
    ctx.move_to(x, y + length)
    ctx.line_to(x, y - length)
    ctx.move_to(x + length, y)
    ctx.line_to(x - length, y)
    ctx.stroke()
    ctx.restore()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号