Skip to content

Commit

Permalink
Add Point.toOffset extension method
Browse files Browse the repository at this point in the history
Co-authored-by: 6y <tlserver6y@gmail.com>
  • Loading branch information
rorystephenson and tlserver committed Jul 18, 2023
1 parent 12f9a62 commit 6d517a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/src/misc/point_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ extension PointExtension<T extends num> on Point<T> {
Point<int> toIntPoint() => Point<int>(x.toInt(), y.toInt());

Point<double> toDoublePoint() => Point<double>(x.toDouble(), y.toDouble());

Offset toOffset() => Offset(x.toDouble(), y.toDouble());
}

/// This extension contains methods which, if defined on Point<T extends num>,
Expand Down

0 comments on commit 6d517a6

Please sign in to comment.