mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
canvas: Add CanvasPattern 'setTranform(transform)' method (#37731)
Follow the HTML canvas specification and add missing 'setTransform(transform)' method to CanvasPattern interface. https://html.spec.whatwg.org/multipage/#dom-canvaspattern-settransform Testing: Improvements in the tests - html/canvas/element/fill-and-stroke-styles/2d.pattern.transform* - html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform* Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This commit is contained in:
parent
5286869b96
commit
3c16db2642
12 changed files with 65 additions and 51 deletions
|
@ -214,6 +214,7 @@ pub struct SurfaceStyle {
|
|||
pub surface_size: Size2D<u32>,
|
||||
pub repeat_x: bool,
|
||||
pub repeat_y: bool,
|
||||
pub transform: Transform2D<f32>,
|
||||
}
|
||||
|
||||
impl SurfaceStyle {
|
||||
|
@ -222,12 +223,14 @@ impl SurfaceStyle {
|
|||
surface_size: Size2D<u32>,
|
||||
repeat_x: bool,
|
||||
repeat_y: bool,
|
||||
transform: Transform2D<f32>,
|
||||
) -> Self {
|
||||
Self {
|
||||
surface_data: ByteBuf::from(surface_data),
|
||||
surface_size,
|
||||
repeat_x,
|
||||
repeat_y,
|
||||
transform,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue