Files
serenity/Userland/Libraries/LibWeb/HTML/Canvas/CanvasPathDrawingStyles.idl
Nico Weber c30188cd6a LibWeb: Hook up canvas lineCap and plumb it to LibGfx
To rebaseline image test expecatations, I ran:

    out/gn/Ladybird.app/Contents/MacOS/headless-browser \
        --resources $PWD/out/gn/Ladybird.app/Contents/Resources \
        --dump-failed-ref-tests \
        --run-tests $PWD/Tests/LibWeb \
        --filter 'canvas-*'

I then copied over the new baselines with

    D=Tests/LibWeb/Ref/reference/images
    cp test-dumps/canvas-implict-moves-and-lines.png \
        $D/canvas-implict-moves-and-lines-ref.png

(Note: No `-ref` suffix on first path, yes suffix on second path.)

We currently don't track if a path is open or closed, and paint
butt linecaps at the end of closed paths too. We did that with
round linecaps as well, but there that wasn't visible. This makes
closed paths look a bit weird now; we'll have to fix this in a
follow-up. In a way, this just exposes another not-yet-implemented
feature.
2024-09-27 15:05:30 -04:00

16 lines
673 B
Plaintext

// https://html.spec.whatwg.org/multipage/canvas.html#canvaslinecap
// enum CanvasLineCap { "butt", "round", "square" };
// enum CanvasLineJoin { "round", "bevel", "miter" };
// https://html.spec.whatwg.org/multipage/canvas.html#canvaspathdrawingstyles
interface mixin CanvasPathDrawingStyles {
attribute unrestricted double lineWidth;
attribute CanvasLineCap lineCap;
[FIXME] attribute CanvasLineJoin lineJoin;
[FIXME] attribute unrestricted double miterLimit;
[FIXME] undefined setLineDash(sequence<unrestricted double> segments);
[FIXME] sequence<unrestricted double> getLineDash();
[FIXME] attribute unrestricted double lineDashOffset;
};