-
-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Rect
extension docs is out of date
#1451
Conversation
@@ -83,8 +83,7 @@ extension RectExtension on Rect { | |||
return Rect.fromPoints(Offset(minX, minY), Offset(maxX, maxY)); | |||
} | |||
|
|||
/// Constructs a rectangle from its center point (specified as a Vector2), | |||
/// width and height. | |||
/// Constructs a [Rect] with a [width] and [height] around the [center] point. | |||
static Rect fromVector2Center({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda want to rename this one because I think it was forgotten in the Vector2
migration. But that would be a breaking change (unless we deprecate it and proxy it to the renamed one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to do that change in another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets do that in a follow up if the rest of the team agrees.
@@ -74,7 +74,7 @@ extension RectExtension on Rect { | |||
); | |||
} | |||
|
|||
/// Creates bounds in from of a [Rect] from a list of [Vector2] | |||
/// Creates a [Rect] that represents the bounds of the list [pts]. | |||
static Rect fromBounds(List<Vector2> pts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is incorrect in my opinion. It does not create a Rect based on a given bounds, instead it returns a Rect that is the bounds of the list!
So I suggest we also deprecate this and proxy it to a correctly named factory.
Description
The
Rect
extension docs is out of date, and the factory methods were confusing to read, they were not explaining themselves easily so I have updated them as well.Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
.Breaking Change
Related Issues