audulus/vger

missing vgerStroke function like vgerFill

emenwin opened this issue · 1 comments

draw multiple bezier lines, use vgerStrokeBezier(vgerContext vg, vgerBezierSegment s, float width, vgerPaintIndex paint)

when paint color is transparent,start/end point draw more times.

let linepaint2 = vgerColorPaint(vger, .init(x: 0, y: 1, z: 0, w: 0.5))
let linepaint3 = vgerColorPaint(vger, .init(x: 0, y: 0, z: 1, w: 0.5))

        vgerStrokeBezier(vger, vgerBezierSegment(a:
                .init(x: 240, y: 360),
                 b: .init(x: 260, y: 350),
                 c: .init(x: 280, y: 450)), 20.0, linepaint2)
        vgerStrokeBezier(vger, vgerBezierSegment(a:
                .init(x: 280, y: 450),
                 b: .init(x: 285, y: 490),
                 c: .init(x: 320, y: 490)), 20.0, linepaint2)
        vgerStrokeBezier(vger, vgerBezierSegment(a:
                .init(x: 320, y: 490),
                 b: .init(x: 325, y: 550),
                 c: .init(x: 340, y: 650)), 20.0, linepaint3)

Screenshot 2023-06-18 at 11 26 04

This is a limitation of the library. It's tricky to do SDFs for compound strokes. I'd recommend converting your stroke to a fill.