1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:57:44 +00:00

LibWeb: Extract CanvasTransform class from CRC2D

The implementation of this got a little funky, because it has to access
methods from CanvasState.
This commit is contained in:
Sam Atkins 2022-08-12 14:48:11 +01:00 committed by Andreas Kling
parent 08e6071ebb
commit aa87b9699e
5 changed files with 101 additions and 69 deletions

View file

@ -0,0 +1,12 @@
// https://html.spec.whatwg.org/multipage/canvas.html#canvastransform
interface mixin CanvasTransform {
undefined scale(unrestricted double x, unrestricted double y);
undefined rotate(unrestricted double radians);
undefined translate(unrestricted double x, unrestricted double y);
undefined transform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
// FIXME: [NewObject] DOMMatrix getTransform();
undefined setTransform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
// FIXME: undefined setTransform(optional DOMMatrix2DInit transform = {});
undefined resetTransform();
};