Skip to content

Commit

Permalink
[path_parsing] deprecate utility functions that should be private (#7993
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo authored Nov 1, 2024
1 parent 796afa3 commit 3c3181c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions third_party/packages/path_parsing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.1.0

* Deprecates top-level utility functions `blendPoints` and `reflectedPoint` and
some members in `PathSegmentData`.

## 1.0.3

* Updates README.md.
Expand Down
15 changes: 15 additions & 0 deletions third_party/packages/path_parsing/lib/src/path_parsing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ class SvgPathStringSource {
}
}

@Deprecated('Utility function that should not be public.')
// TODO(kevmoo): Remove this in the next release https://github.com/flutter/flutter/issues/157940
_PathOffset reflectedPoint(
_PathOffset reflectedIn, _PathOffset pointToReflect) {
return _PathOffset(2 * reflectedIn.dx - pointToReflect.dx,
Expand All @@ -420,6 +422,8 @@ _PathOffset reflectedPoint(
const double _kOneOverThree = 1.0 / 3.0;

/// Blend the points with a ratio (1/3):(2/3).
@Deprecated('Utility function that should not be public.')
// TODO(kevmoo): Remove this in the next release https://github.com/flutter/flutter/issues/157940
_PathOffset blendPoints(_PathOffset p1, _PathOffset p2) {
return _PathOffset((p1.dx + 2 * p2.dx) * _kOneOverThree,
(p1.dy + 2 * p2.dy) * _kOneOverThree);
Expand Down Expand Up @@ -447,6 +451,8 @@ class PathSegmentData {
arcSweep = false,
arcLarge = false;

@Deprecated('Utility member that should not be public.')
// TODO(kevmoo): Remove this in the next release https://github.com/flutter/flutter/issues/157940
_PathOffset get arcRadii => point1;

/// Angle in degrees.
Expand All @@ -471,8 +477,17 @@ class PathSegmentData {
double get y2 => point2.dy;

SvgPathSegType command;

@Deprecated('Utility member that should not be public.')
// TODO(kevmoo): Remove this in the next release https://github.com/flutter/flutter/issues/157940
_PathOffset targetPoint = _PathOffset.zero;

@Deprecated('Utility member that should not be public.')
// TODO(kevmoo): Remove this in the next release https://github.com/flutter/flutter/issues/157940
_PathOffset point1 = _PathOffset.zero;

@Deprecated('Utility member that should not be public.')
// TODO(kevmoo): Remove this in the next release https://github.com/flutter/flutter/issues/157940
_PathOffset point2 = _PathOffset.zero;
bool arcSweep;
bool arcLarge;
Expand Down
2 changes: 1 addition & 1 deletion third_party/packages/path_parsing/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >
A Dart library to help with SVG Path parsing and code generation. Used by Flutter SVG.
repository: https://github.com/flutter/packages/tree/main/third_party/packages/path_parsing
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_parsing%22
version: 1.0.3
version: 1.1.0

environment:
sdk: ^3.3.0
Expand Down

0 comments on commit 3c3181c

Please sign in to comment.