mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00
LibWeb: Implement CanvasRenderingContext2D.transform
This commit is contained in:
parent
40f584a2bb
commit
df7a83ac0e
3 changed files with 19 additions and 0 deletions
|
@ -691,6 +691,20 @@ NonnullRefPtr<CanvasGradient> CanvasRenderingContext2D::create_conic_gradient(do
|
|||
return CanvasGradient::create_conic(start_angle, x, y);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-transform
|
||||
void CanvasRenderingContext2D::transform(double a, double b, double c, double d, double e, double f)
|
||||
{
|
||||
// 1. If any of the arguments are infinite or NaN, then return.
|
||||
if (!isfinite(a) || !isfinite(b) || !isfinite(c) || !isfinite(d) || !isfinite(e) || !isfinite(f))
|
||||
return;
|
||||
|
||||
// 2. Replace the current transformation matrix with the result of multiplying the current transformation matrix with the matrix described by:
|
||||
// a c e
|
||||
// b d f
|
||||
// 0 0 1
|
||||
m_drawing_state.transform.multiply({ static_cast<float>(a), static_cast<float>(b), static_cast<float>(c), static_cast<float>(d), static_cast<float>(e), static_cast<float>(f) });
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue