From 30f558bb8176f0ec7616aec06649dc9b7dcbd5b2 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Tue, 13 May 2025 16:20:26 -0700 Subject: [PATCH 1/3] Remove prefer-inline for non-trivial Matrix functions --- lib/src/vector_math/matrix4.dart | 11 +---------- lib/src/vector_math_64/matrix4.dart | 11 +---------- lib/src/vector_math_64/quad.dart | 2 +- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/lib/src/vector_math/matrix4.dart b/lib/src/vector_math/matrix4.dart index 8c82523c..7a3060ad 100644 --- a/lib/src/vector_math/matrix4.dart +++ b/lib/src/vector_math/matrix4.dart @@ -691,10 +691,7 @@ class Matrix4 { } /// Translate this matrix by x, y, z, w. - @pragma('wasm:prefer-inline') - @pragma('vm:prefer-inline') - @pragma('dart2js:prefer-inline') - void translateByDouble(double tx, double ty, double tz, double tw) { + void translateByDouble(double tx, double ty, double tz, [double tw = 1.0]) { final t1 = _m4storage[0] * tx + _m4storage[4] * ty + _m4storage[8] * tz + @@ -760,9 +757,6 @@ class Matrix4 { } /// Multiply this by a translation from the left. - @pragma('wasm:prefer-inline') - @pragma('vm:prefer-inline') - @pragma('dart2js:prefer-inline') void leftTranslateByDouble(double tx, double ty, double tz, double tw) { // Column 1 final r1 = _m4storage[3]; @@ -941,9 +935,6 @@ class Matrix4 { } /// Scale this matrix. - @pragma('wasm:prefer-inline') - @pragma('vm:prefer-inline') - @pragma('dart2js:prefer-inline') void scaleByDouble(double sx, double sy, double sz, double sw) { _m4storage[0] *= sx; _m4storage[1] *= sx; diff --git a/lib/src/vector_math_64/matrix4.dart b/lib/src/vector_math_64/matrix4.dart index f1ed9f00..d2313bc2 100644 --- a/lib/src/vector_math_64/matrix4.dart +++ b/lib/src/vector_math_64/matrix4.dart @@ -691,10 +691,7 @@ class Matrix4 { } /// Translate this matrix by x, y, z, w. - @pragma('wasm:prefer-inline') - @pragma('vm:prefer-inline') - @pragma('dart2js:prefer-inline') - void translateByDouble(double tx, double ty, double tz, double tw) { + void translateByDouble(double tx, double ty, double tz, [double tw = 1.0]) { final t1 = _m4storage[0] * tx + _m4storage[4] * ty + _m4storage[8] * tz + @@ -760,9 +757,6 @@ class Matrix4 { } /// Multiply this by a translation from the left. - @pragma('wasm:prefer-inline') - @pragma('vm:prefer-inline') - @pragma('dart2js:prefer-inline') void leftTranslateByDouble(double tx, double ty, double tz, double tw) { // Column 1 final r1 = _m4storage[3]; @@ -941,9 +935,6 @@ class Matrix4 { } /// Scale this matrix. - @pragma('wasm:prefer-inline') - @pragma('vm:prefer-inline') - @pragma('dart2js:prefer-inline') void scaleByDouble(double sx, double sy, double sz, double sw) { _m4storage[0] *= sx; _m4storage[1] *= sx; diff --git a/lib/src/vector_math_64/quad.dart b/lib/src/vector_math_64/quad.dart index 04eb6255..94c4ab13 100644 --- a/lib/src/vector_math_64/quad.dart +++ b/lib/src/vector_math_64/quad.dart @@ -20,7 +20,7 @@ class Quad { /// The third point of the quad. Vector3 get point2 => _point2; - /// The third point of the quad. + /// The fourth point of the quad. Vector3 get point3 => _point3; /// Create a new, uninitialized quad. From 03a51c5437aebe9ce331c58e197c20cd613615ed Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Tue, 13 May 2025 16:22:36 -0700 Subject: [PATCH 2/3] oops --- lib/src/vector_math/matrix4.dart | 2 +- lib/src/vector_math_64/matrix4.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/vector_math/matrix4.dart b/lib/src/vector_math/matrix4.dart index 7a3060ad..123ca940 100644 --- a/lib/src/vector_math/matrix4.dart +++ b/lib/src/vector_math/matrix4.dart @@ -691,7 +691,7 @@ class Matrix4 { } /// Translate this matrix by x, y, z, w. - void translateByDouble(double tx, double ty, double tz, [double tw = 1.0]) { + void translateByDouble(double tx, double ty, double tz, double tw) { final t1 = _m4storage[0] * tx + _m4storage[4] * ty + _m4storage[8] * tz + diff --git a/lib/src/vector_math_64/matrix4.dart b/lib/src/vector_math_64/matrix4.dart index d2313bc2..c5e8981c 100644 --- a/lib/src/vector_math_64/matrix4.dart +++ b/lib/src/vector_math_64/matrix4.dart @@ -691,7 +691,7 @@ class Matrix4 { } /// Translate this matrix by x, y, z, w. - void translateByDouble(double tx, double ty, double tz, [double tw = 1.0]) { + void translateByDouble(double tx, double ty, double tz, double tw) { final t1 = _m4storage[0] * tx + _m4storage[4] * ty + _m4storage[8] * tz + From 62f56813e9274bf660ba98d0b25fde9e15458df5 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Wed, 14 May 2025 14:34:25 -0700 Subject: [PATCH 3/3] Prepare release --- CHANGELOG.md | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 398ef8f8..d85213dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.2.0-wip +## 2.2.0 - Performance of functions that take `dynamic` arguments improved. - Most of the members that take `dynamic` arguments are deprecated. New members diff --git a/pubspec.yaml b/pubspec.yaml index 162d06c0..22b2ebd2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: vector_math -version: 2.2.0-wip +version: 2.2.0 description: A Vector Math library for 2D and 3D applications. repository: https://github.com/google/vector_math.dart