Skip to content

Commit f18a4ae

Browse files
ValentinVignalvictorsanni
authored andcommitted
[vector_graphics_compiler] Fix deprecation issues in tests (flutter#12700)
Part of flutter/flutter#178120 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent f9889d2 commit f18a4ae

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎packages/vector_graphics_compiler/test/matrix_test.dart‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ void main() {
5454
const matrix1 = AffineMatrix(2, 2, 3, 4, 5, 6);
5555

5656
final matrix4_1 = Matrix4.fromFloat64List(matrix1.toMatrix4());
57-
expect(matrix1.scaled(2, 3).toMatrix4(), matrix4_1.scaled(2.0, 3.0).storage);
57+
expect(matrix1.scaled(2, 3).toMatrix4(), matrix4_1.scaledByDouble(2, 3, 2, 1).storage);
5858

59-
expect(matrix1.scaled(2).toMatrix4(), matrix4_1.scaled(2.0, 2.0).storage);
59+
expect(matrix1.scaled(2).toMatrix4(), matrix4_1.scaledByDouble(2, 2, 2, 1).storage);
6060
});
6161

6262
test('Scale and multiply', () {
@@ -67,7 +67,7 @@ void main() {
6767
final matrix4_2 = Matrix4.fromFloat64List(matrix2.toMatrix4());
6868
expect(
6969
matrix1.scaled(2, 3).multiplied(matrix2).toMatrix4(),
70-
matrix4_1.scaled(2.0, 3.0).multiplied(matrix4_2).storage,
70+
matrix4_1.scaledByDouble(2, 3, 2, 1).multiplied(matrix4_2).storage,
7171
);
7272
});
7373

@@ -82,7 +82,7 @@ void main() {
8282
const matrix1 = AffineMatrix(2, 2, 3, 4, 5, 6);
8383

8484
final matrix4_1 = Matrix4.fromFloat64List(matrix1.toMatrix4());
85-
matrix4_1.translate(2.0, 3.0);
85+
matrix4_1.translateByDouble(2, 3, 0, 1);
8686
expect(matrix1.translated(2, 3).toMatrix4(), matrix4_1.storage);
8787
});
8888

@@ -94,7 +94,7 @@ void main() {
9494
});
9595

9696
test('transformRect', () {
97-
const epsillon = .0000001;
97+
const epsilon = .0000001;
9898
const rectangle20x20 = Rect.fromLTRB(10, 20, 30, 40);
9999

100100
// Identity
@@ -110,10 +110,10 @@ void main() {
110110
final Rect rotatedRect = AffineMatrix.identity
111111
.rotated(math.pi / 2.0)
112112
.transformRect(rectangle20x20);
113-
expect(rotatedRect.left + 40, lessThan(epsillon));
114-
expect(rotatedRect.top - 10, lessThan(epsillon));
115-
expect(rotatedRect.right + 20, lessThan(epsillon));
116-
expect(rotatedRect.bottom - 30, lessThan(epsillon));
113+
expect(rotatedRect.left + 40, lessThan(epsilon));
114+
expect(rotatedRect.top - 10, lessThan(epsilon));
115+
expect(rotatedRect.right + 20, lessThan(epsilon));
116+
expect(rotatedRect.bottom - 30, lessThan(epsilon));
117117

118118
// Translation
119119
final Rect shiftedRect = AffineMatrix.identity.translated(10, 20).transformRect(rectangle20x20);

0 commit comments

Comments
 (0)