mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:47:34 +00:00
LibWeb: Implement CanvasRenderingContext2D.resetTransform
This commit is contained in:
parent
329e740c85
commit
27cc8742ce
3 changed files with 9 additions and 0 deletions
|
@ -719,6 +719,13 @@ void CanvasRenderingContext2D::set_transform(double a, double b, double c, doubl
|
|||
transform(a, b, c, d, e, f);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-resettransform
|
||||
void CanvasRenderingContext2D::reset_transform()
|
||||
{
|
||||
// The resetTransform() method, when invoked, must reset the current transformation matrix to the identity matrix.
|
||||
m_drawing_state.transform = {};
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument
|
||||
DOM::ExceptionOr<CanvasImageSourceUsability> check_usability_of_image(CanvasImageSource const& image)
|
||||
{
|
||||
|
|
|
@ -100,6 +100,7 @@ public:
|
|||
|
||||
void transform(double a, double b, double c, double d, double e, double f);
|
||||
void set_transform(double a, double b, double c, double d, double e, double f);
|
||||
void reset_transform();
|
||||
|
||||
private:
|
||||
explicit CanvasRenderingContext2D(HTMLCanvasElement&);
|
||||
|
|
|
@ -58,5 +58,6 @@ interface CanvasRenderingContext2D {
|
|||
// FIXME: All these `double`s should be `unrestricted double`
|
||||
undefined transform(double a, double b, double c, double d, double e, double f);
|
||||
undefined setTransform(double a, double b, double c, double d, double e, double f);
|
||||
undefined resetTransform();
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue