web/canvas: Convert CanvasPattern transformation matrix from Twips to regular numbers

The reason this did not cause problems so far was that it was far more
common to fall back to the SVG backend right before this piece of code.
This commit is contained in:
TÖRÖK Attila 2021-10-22 01:53:15 +02:00 committed by Adrian Wielgosik
parent 57838f882d
commit 7389b2b9ce
1 changed files with 8 additions and 6 deletions

View File

@ -1443,12 +1443,14 @@ fn swf_shape_to_canvas_commands(
let matrix = matrix_factory.create_svg_matrix();
matrix.set_a(a.a.to_f32());
matrix.set_b(a.b.to_f32());
matrix.set_c(a.c.to_f32());
matrix.set_d(a.d.to_f32());
matrix.set_e(a.tx.get() as f32);
matrix.set_f(a.ty.get() as f32);
// The `1.0 / 20.0` in `bounds_viewbox_matrix` does not
// affect this, so we have to do it manually here.
matrix.set_a(a.a.to_f32() / 20.0);
matrix.set_b(a.b.to_f32() / 20.0);
matrix.set_c(a.c.to_f32() / 20.0);
matrix.set_d(a.d.to_f32() / 20.0);
matrix.set_e(a.tx.get() as f32 / 20.0);
matrix.set_f(a.ty.get() as f32 / 20.0);
bitmap_pattern.set_transform(&matrix);