mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
canvas: use Transform2D
instead of Transform3D
when possible (#37759)
While this makes our implementation deviate slightly from the specification, this clarifies an invariant with the code itself. This helps to resolve some confusion as seen in https://github.com/servo/servo/issues/37695#issuecomment-3013823350. Testing: This should not change behavior and is thus covered by existing WPT tests. --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
e2ad9c14c6
commit
944713ddd0
3 changed files with 32 additions and 76 deletions
|
@ -93,21 +93,14 @@ impl CanvasPatternMethods<crate::DomTypeHolder> for CanvasPattern {
|
|||
!matrix.m12.is_finite() ||
|
||||
!matrix.m21.is_finite() ||
|
||||
!matrix.m22.is_finite() ||
|
||||
!matrix.m41.is_finite() ||
|
||||
!matrix.m42.is_finite()
|
||||
!matrix.m31.is_finite() ||
|
||||
!matrix.m32.is_finite()
|
||||
{
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// Step 3. Reset the pattern's transformation matrix to matrix.
|
||||
*self.transform.borrow_mut() = Transform2D::new(
|
||||
matrix.m11 as f32,
|
||||
matrix.m12 as f32,
|
||||
matrix.m21 as f32,
|
||||
matrix.m22 as f32,
|
||||
matrix.m41 as f32,
|
||||
matrix.m42 as f32,
|
||||
);
|
||||
*self.transform.borrow_mut() = matrix.cast();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue