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

LibWeb: Add DOMMatrix translate

This commit is contained in:
Bastiaan van der Plaat 2023-09-03 12:43:09 +02:00 committed by Andreas Kling
parent 61c063f7b3
commit 5cd35b633a
8 changed files with 49 additions and 2 deletions

View file

@ -239,6 +239,17 @@ bool DOMMatrixReadOnly::is_identity() const
return true;
}
// https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-translate
JS::NonnullGCPtr<DOMMatrix> DOMMatrixReadOnly::translate(Optional<double> const& tx, Optional<double> const& ty, Optional<double> const& tz) const
{
// 1. Let result be the resulting matrix initialized to the values of the current matrix.
auto result = DOMMatrix::create_from_dom_matrix_read_only(realm(), *this);
// 2. Perform a translateSelf() transformation on result with the arguments tx, ty, tz.
// 3. Return result.
return result->translate_self(tx, ty, tz);
}
// https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-multiply
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMMatrix>> DOMMatrixReadOnly::multiply(DOMMatrixInit other)
{