1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

LibWeb: Add initial implementation of CRC2D.clip()

This allows clipping your drawing by any path you like! To do this
all painting has been wrapped around a new draw_clipped() helper
method, which handles the clipping before/after painting.

Note: This clipping is currently missing support for intersecting
clip paths.
This commit is contained in:
MacDue 2023-04-06 20:57:59 +01:00 committed by Linus Groh
parent 92d9b6edb8
commit 20e9213cc4
5 changed files with 126 additions and 102 deletions

View file

@ -13,10 +13,10 @@ interface mixin CanvasDrawPath {
undefined stroke();
undefined stroke(Path2D path);
// FIXME: Replace this with these two definitions:
// undefined clip(optional CanvasFillRule fillRule = "nonzero");
// undefined clip(Path2D path, optional CanvasFillRule fillRule = "nonzero");
undefined clip();
// FIXME: `DOMString` should be `CanvasFillRule`
undefined clip(optional DOMString fillRule = "nonzero");
// FIXME: `DOMString` should be `CanvasFillRule`
undefined clip(Path2D path, optional DOMString fillRule = "nonzero");
// FIXME: boolean isPointInPath(unrestricted double x, unrestricted double y, optional CanvasFillRule fillRule = "nonzero");
// FIXME: boolean isPointInPath(Path2D path, unrestricted double x, unrestricted double y, optional CanvasFillRule fillRule = "nonzero");