diff --git a/packages/vector_graphics_compiler/test/matrix_test.dart b/packages/vector_graphics_compiler/test/matrix_test.dart index 1ac35de1a8e0..746eed3e57ce 100644 --- a/packages/vector_graphics_compiler/test/matrix_test.dart +++ b/packages/vector_graphics_compiler/test/matrix_test.dart @@ -54,9 +54,9 @@ void main() { const matrix1 = AffineMatrix(2, 2, 3, 4, 5, 6); final matrix4_1 = Matrix4.fromFloat64List(matrix1.toMatrix4()); - expect(matrix1.scaled(2, 3).toMatrix4(), matrix4_1.scaled(2.0, 3.0).storage); + expect(matrix1.scaled(2, 3).toMatrix4(), matrix4_1.scaledByDouble(2, 3, 2, 1).storage); - expect(matrix1.scaled(2).toMatrix4(), matrix4_1.scaled(2.0, 2.0).storage); + expect(matrix1.scaled(2).toMatrix4(), matrix4_1.scaledByDouble(2, 2, 2, 1).storage); }); test('Scale and multiply', () { @@ -67,7 +67,7 @@ void main() { final matrix4_2 = Matrix4.fromFloat64List(matrix2.toMatrix4()); expect( matrix1.scaled(2, 3).multiplied(matrix2).toMatrix4(), - matrix4_1.scaled(2.0, 3.0).multiplied(matrix4_2).storage, + matrix4_1.scaledByDouble(2, 3, 2, 1).multiplied(matrix4_2).storage, ); }); @@ -82,7 +82,7 @@ void main() { const matrix1 = AffineMatrix(2, 2, 3, 4, 5, 6); final matrix4_1 = Matrix4.fromFloat64List(matrix1.toMatrix4()); - matrix4_1.translate(2.0, 3.0); + matrix4_1.translateByDouble(2, 3, 0, 1); expect(matrix1.translated(2, 3).toMatrix4(), matrix4_1.storage); }); @@ -94,7 +94,7 @@ void main() { }); test('transformRect', () { - const epsillon = .0000001; + const epsilon = .0000001; const rectangle20x20 = Rect.fromLTRB(10, 20, 30, 40); // Identity @@ -110,10 +110,10 @@ void main() { final Rect rotatedRect = AffineMatrix.identity .rotated(math.pi / 2.0) .transformRect(rectangle20x20); - expect(rotatedRect.left + 40, lessThan(epsillon)); - expect(rotatedRect.top - 10, lessThan(epsillon)); - expect(rotatedRect.right + 20, lessThan(epsillon)); - expect(rotatedRect.bottom - 30, lessThan(epsillon)); + expect(rotatedRect.left + 40, lessThan(epsilon)); + expect(rotatedRect.top - 10, lessThan(epsilon)); + expect(rotatedRect.right + 20, lessThan(epsilon)); + expect(rotatedRect.bottom - 30, lessThan(epsilon)); // Translation final Rect shiftedRect = AffineMatrix.identity.translated(10, 20).transformRect(rectangle20x20);