Add Path2D (#35783)

Signed-off-by: Lukas Lihotzki <lukas@lihotzki.de>
This commit is contained in:
Lukas Lihotzki 2025-03-26 13:12:44 +01:00 committed by GitHub
parent f0ea3c6150
commit 251eeb2c2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 1566 additions and 262 deletions

View file

@ -117,15 +117,15 @@ interface mixin CanvasDrawPath {
// path API (see also CanvasPath)
undefined beginPath();
undefined fill(optional CanvasFillRule fillRule = "nonzero");
//void fill(Path2D path, optional CanvasFillRule fillRule = "nonzero");
undefined fill(Path2D path, optional CanvasFillRule fillRule = "nonzero");
undefined stroke();
//void stroke(Path2D path);
undefined stroke(Path2D path);
undefined clip(optional CanvasFillRule fillRule = "nonzero");
//void clip(Path2D path, optional CanvasFillRule fillRule = "nonzero");
undefined clip(Path2D path, optional CanvasFillRule fillRule = "nonzero");
boolean isPointInPath(unrestricted double x, unrestricted double y,
optional CanvasFillRule fillRule = "nonzero");
//boolean isPointInPath(Path2D path, unrestricted double x, unrestricted double y,
// optional CanvasFillRule fillRule = "nonzero");
boolean isPointInPath(Path2D path, unrestricted double x, unrestricted double y,
optional CanvasFillRule fillRule = "nonzero");
//boolean isPointInStroke(unrestricted double x, unrestricted double y);
//boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted double y);
};
@ -262,3 +262,12 @@ interface ImageData {
[Throws] readonly attribute Uint8ClampedArray data;
//readonly attribute PredefinedColorSpace colorSpace;
};
[Exposed=(Window,Worker)]
interface Path2D {
constructor();
constructor(Path2D other);
constructor(DOMString pathString);
undefined addPath(Path2D path/*, SVGMatrix? transformation*/);
};
Path2D includes CanvasPath;