From c36908841f8c3f368d4142b36806f630d7709466 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Tue, 24 Oct 2023 15:59:09 -0700 Subject: [PATCH 1/4] oops --- packages/vector_graphics/CHANGELOG.md | 4 ++++ packages/vector_graphics/pubspec.yaml | 6 +++--- packages/vector_graphics_codec/CHANGELOG.md | 4 ++++ packages/vector_graphics_codec/pubspec.yaml | 2 +- packages/vector_graphics_compiler/CHANGELOG.md | 4 ++++ packages/vector_graphics_compiler/pubspec.yaml | 6 +++--- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/vector_graphics/CHANGELOG.md b/packages/vector_graphics/CHANGELOG.md index d0233d9b..eb5ea5ea 100644 --- a/packages/vector_graphics/CHANGELOG.md +++ b/packages/vector_graphics/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 1.1.9+1 + +- Fix publication error that did not have latest source code. + ## 1.1.9 - Fix handling of invalid XML `@id` attributes. diff --git a/packages/vector_graphics/pubspec.yaml b/packages/vector_graphics/pubspec.yaml index 243979f6..dd7e6c67 100644 --- a/packages/vector_graphics/pubspec.yaml +++ b/packages/vector_graphics/pubspec.yaml @@ -1,6 +1,6 @@ name: vector_graphics description: A vector graphics rendering package for Flutter. -version: 1.1.9 +version: 1.1.9+1 homepage: https://github.com/dnfield/vector_graphics environment: @@ -10,13 +10,13 @@ environment: dependencies: flutter: sdk: flutter - vector_graphics_codec: 1.1.9 + vector_graphics_codec: 1.1.9+1 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^1.0.0 - vector_graphics_compiler: 1.1.9 + vector_graphics_compiler: 1.1.9+1 # Comment out before publishing dependency_overrides: diff --git a/packages/vector_graphics_codec/CHANGELOG.md b/packages/vector_graphics_codec/CHANGELOG.md index e72b21f8..bd0d49fd 100644 --- a/packages/vector_graphics_codec/CHANGELOG.md +++ b/packages/vector_graphics_codec/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 1.1.9+1 + +- Fix publication error that did not have latest source code. + ## 1.1.9 - Fix handling of invalid XML `@id` attributes. diff --git a/packages/vector_graphics_codec/pubspec.yaml b/packages/vector_graphics_codec/pubspec.yaml index fcb1319b..fbd739b5 100644 --- a/packages/vector_graphics_codec/pubspec.yaml +++ b/packages/vector_graphics_codec/pubspec.yaml @@ -1,6 +1,6 @@ name: vector_graphics_codec description: An encoding library for `package:vector_graphics` -version: 1.1.9 +version: 1.1.9+1 homepage: https://github.com/dnfield/vector_graphics environment: diff --git a/packages/vector_graphics_compiler/CHANGELOG.md b/packages/vector_graphics_compiler/CHANGELOG.md index f4eded61..8224abe9 100644 --- a/packages/vector_graphics_compiler/CHANGELOG.md +++ b/packages/vector_graphics_compiler/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 1.1.9+1 + +- Fix publication error that did not have latest source code. + ## 1.1.9 - Fix handling of invalid XML `@id` attributes. diff --git a/packages/vector_graphics_compiler/pubspec.yaml b/packages/vector_graphics_compiler/pubspec.yaml index efe891fe..2e712112 100644 --- a/packages/vector_graphics_compiler/pubspec.yaml +++ b/packages/vector_graphics_compiler/pubspec.yaml @@ -1,6 +1,6 @@ name: vector_graphics_compiler description: A compiler for `package:vector_graphics`. -version: 1.1.9 +version: 1.1.9+1 homepage: https://github.com/dnfield/vector_graphics executables: @@ -14,7 +14,7 @@ dependencies: meta: ^1.7.0 path_parsing: ^1.0.1 xml: ^6.3.0 - vector_graphics_codec: 1.1.9 + vector_graphics_codec: 1.1.9+1 path: ^1.8.0 dev_dependencies: @@ -25,7 +25,7 @@ dev_dependencies: sdk: flutter flutter_test: sdk: flutter - vector_graphics: 1.1.9 + vector_graphics: 1.1.9+1 # Comment out before publishing dependency_overrides: From eebdc2a1d32d455537e1c45b84c4dde4a6cd154d Mon Sep 17 00:00:00 2001 From: Dan Field Date: Sun, 7 Jan 2024 20:09:11 -0800 Subject: [PATCH 2/4] Fix scientific notation parsing --- packages/vector_graphics/CHANGELOG.md | 4 ++++ packages/vector_graphics/pubspec.yaml | 6 +++--- packages/vector_graphics_codec/CHANGELOG.md | 4 ++++ packages/vector_graphics_codec/pubspec.yaml | 2 +- packages/vector_graphics_compiler/CHANGELOG.md | 4 ++++ packages/vector_graphics_compiler/lib/src/svg/parsers.dart | 2 +- packages/vector_graphics_compiler/pubspec.yaml | 6 +++--- packages/vector_graphics_compiler/test/parsers_test.dart | 5 +++++ 8 files changed, 25 insertions(+), 8 deletions(-) diff --git a/packages/vector_graphics/CHANGELOG.md b/packages/vector_graphics/CHANGELOG.md index eb5ea5ea..ebe15d26 100644 --- a/packages/vector_graphics/CHANGELOG.md +++ b/packages/vector_graphics/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 1.1.9+2 + +- Fix case sensitivity on scientific notation parsing. + ## 1.1.9+1 - Fix publication error that did not have latest source code. diff --git a/packages/vector_graphics/pubspec.yaml b/packages/vector_graphics/pubspec.yaml index dd7e6c67..27bac61e 100644 --- a/packages/vector_graphics/pubspec.yaml +++ b/packages/vector_graphics/pubspec.yaml @@ -1,6 +1,6 @@ name: vector_graphics description: A vector graphics rendering package for Flutter. -version: 1.1.9+1 +version: 1.1.9+2 homepage: https://github.com/dnfield/vector_graphics environment: @@ -10,13 +10,13 @@ environment: dependencies: flutter: sdk: flutter - vector_graphics_codec: 1.1.9+1 + vector_graphics_codec: 1.1.9+2 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^1.0.0 - vector_graphics_compiler: 1.1.9+1 + vector_graphics_compiler: 1.1.9+2 # Comment out before publishing dependency_overrides: diff --git a/packages/vector_graphics_codec/CHANGELOG.md b/packages/vector_graphics_codec/CHANGELOG.md index bd0d49fd..6928cc91 100644 --- a/packages/vector_graphics_codec/CHANGELOG.md +++ b/packages/vector_graphics_codec/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 1.1.9+2 + +- Fix case sensitivity on scientific notation parsing. + ## 1.1.9+1 - Fix publication error that did not have latest source code. diff --git a/packages/vector_graphics_codec/pubspec.yaml b/packages/vector_graphics_codec/pubspec.yaml index fbd739b5..8c355414 100644 --- a/packages/vector_graphics_codec/pubspec.yaml +++ b/packages/vector_graphics_codec/pubspec.yaml @@ -1,6 +1,6 @@ name: vector_graphics_codec description: An encoding library for `package:vector_graphics` -version: 1.1.9+1 +version: 1.1.9+2 homepage: https://github.com/dnfield/vector_graphics environment: diff --git a/packages/vector_graphics_compiler/CHANGELOG.md b/packages/vector_graphics_compiler/CHANGELOG.md index 8224abe9..0811ad8b 100644 --- a/packages/vector_graphics_compiler/CHANGELOG.md +++ b/packages/vector_graphics_compiler/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 1.1.9+2 + +- Fix case sensitivity on scientific notation parsing. + ## 1.1.9+1 - Fix publication error that did not have latest source code. diff --git a/packages/vector_graphics_compiler/lib/src/svg/parsers.dart b/packages/vector_graphics_compiler/lib/src/svg/parsers.dart index fc7e2b1f..a4f96c2a 100644 --- a/packages/vector_graphics_compiler/lib/src/svg/parsers.dart +++ b/packages/vector_graphics_compiler/lib/src/svg/parsers.dart @@ -31,7 +31,7 @@ List _parseTransformParams(String params) { for (int i = 0; i < params.length; i += 1) { final String char = params[i]; final bool isSeparator = char == ' ' || char == '-' || char == ','; - final bool isExponent = i > 0 && params[i - 1] == 'e'; + final bool isExponent = i > 0 && params[i - 1].toLowerCase() == 'e'; if (isSeparator && !isExponent) { if (current != '') { result.add(parseDouble(current)!); diff --git a/packages/vector_graphics_compiler/pubspec.yaml b/packages/vector_graphics_compiler/pubspec.yaml index 2e712112..e301a9d8 100644 --- a/packages/vector_graphics_compiler/pubspec.yaml +++ b/packages/vector_graphics_compiler/pubspec.yaml @@ -1,6 +1,6 @@ name: vector_graphics_compiler description: A compiler for `package:vector_graphics`. -version: 1.1.9+1 +version: 1.1.9+2 homepage: https://github.com/dnfield/vector_graphics executables: @@ -14,7 +14,7 @@ dependencies: meta: ^1.7.0 path_parsing: ^1.0.1 xml: ^6.3.0 - vector_graphics_codec: 1.1.9+1 + vector_graphics_codec: 1.1.9+2 path: ^1.8.0 dev_dependencies: @@ -25,7 +25,7 @@ dev_dependencies: sdk: flutter flutter_test: sdk: flutter - vector_graphics: 1.1.9+1 + vector_graphics: 1.1.9+2 # Comment out before publishing dependency_overrides: diff --git a/packages/vector_graphics_compiler/test/parsers_test.dart b/packages/vector_graphics_compiler/test/parsers_test.dart index 67003f1e..5739ab7f 100644 --- a/packages/vector_graphics_compiler/test/parsers_test.dart +++ b/packages/vector_graphics_compiler/test/parsers_test.dart @@ -178,6 +178,11 @@ void main() { parseTransform('translate(9e-6,6.5e-4)'), AffineMatrix.identity.translated(9e-6, 6.5e-4), ); + + expect( + parseTransform('translate(9E-6,6.5E-4)'), + AffineMatrix.identity.translated(9e-6, 6.5e-4), + ); }); test('Parse a transform with a missing space', () { From 9688ff92ecadff6e2c640301346e529476b07b56 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 8 Jan 2024 06:52:53 -0800 Subject: [PATCH 3/4] Update packages/vector_graphics_compiler/test/parsers_test.dart Co-authored-by: Jonah Williams --- packages/vector_graphics_compiler/test/parsers_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vector_graphics_compiler/test/parsers_test.dart b/packages/vector_graphics_compiler/test/parsers_test.dart index 5739ab7f..53f4769f 100644 --- a/packages/vector_graphics_compiler/test/parsers_test.dart +++ b/packages/vector_graphics_compiler/test/parsers_test.dart @@ -179,7 +179,7 @@ void main() { AffineMatrix.identity.translated(9e-6, 6.5e-4), ); - expect( + expect( parseTransform('translate(9E-6,6.5E-4)'), AffineMatrix.identity.translated(9e-6, 6.5e-4), ); From 35b4f7ed08201a3505340829f1f346f0f8cf7ca9 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 8 Jan 2024 09:50:28 -0800 Subject: [PATCH 4/4] Fix up analysis issues and half implemented test --- .../lib/src/svg/_path_ops_ffi.dart | 2 +- .../vector_graphics_compiler/lib/src/svg/theme.dart | 2 +- .../vector_graphics_compiler/test/parsers_test.dart | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/vector_graphics_compiler/lib/src/svg/_path_ops_ffi.dart b/packages/vector_graphics_compiler/lib/src/svg/_path_ops_ffi.dart index 518f8040..389e942c 100644 --- a/packages/vector_graphics_compiler/lib/src/svg/_path_ops_ffi.dart +++ b/packages/vector_graphics_compiler/lib/src/svg/_path_ops_ffi.dart @@ -119,7 +119,7 @@ class Path implements PathProxy { _updatePathData(); final int count = _pathData!.ref.verbCount; return List.generate(count, (int index) { - return pathVerbDict[_pathData!.ref.verbs.elementAt(index).value]!; + return pathVerbDict[_pathData!.ref.verbs[index]]!; }, growable: false); } diff --git a/packages/vector_graphics_compiler/lib/src/svg/theme.dart b/packages/vector_graphics_compiler/lib/src/svg/theme.dart index 05a57c34..d82ed511 100644 --- a/packages/vector_graphics_compiler/lib/src/svg/theme.dart +++ b/packages/vector_graphics_compiler/lib/src/svg/theme.dart @@ -33,7 +33,7 @@ class SvgTheme { final double xHeight; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) { return false; } diff --git a/packages/vector_graphics_compiler/test/parsers_test.dart b/packages/vector_graphics_compiler/test/parsers_test.dart index 5739ab7f..0e0a9552 100644 --- a/packages/vector_graphics_compiler/test/parsers_test.dart +++ b/packages/vector_graphics_compiler/test/parsers_test.dart @@ -179,7 +179,7 @@ void main() { AffineMatrix.identity.translated(9e-6, 6.5e-4), ); - expect( + expect( parseTransform('translate(9E-6,6.5E-4)'), AffineMatrix.identity.translated(9e-6, 6.5e-4), ); @@ -193,7 +193,15 @@ void main() { }); test('Parse a transform with doubled periods', () { - print(parseTransform('matrix(.70711-.70711.70711.70711-640.89 452.68)')); + expect( + parseTransform('matrix(.70711-.70711.70711.70711-640.89 452.68)'), + const AffineMatrix( + 0.70711, -0.70711, // + 0.70711, 0.70711, // + -640.89, 452.68, // + 0.70711, // + ), + ); }); }