Skip to content
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

Merged
merged 4 commits into from
Mar 15, 2022
Merged

Conversation

wolfenrain
Copy link
Contributor

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

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Related Issues

@@ -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({
Copy link
Contributor Author

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).

Copy link
Member

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?

Copy link
Contributor Author

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) {
Copy link
Contributor Author

@wolfenrain wolfenrain Mar 14, 2022

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.

doc/flame/other/util.md Show resolved Hide resolved
doc/flame/other/util.md Outdated Show resolved Hide resolved
@spydon spydon enabled auto-merge (squash) March 15, 2022 13:08
@spydon spydon merged commit 7e50572 into main Mar 15, 2022
@spydon spydon deleted the wolfen.fixing-docs-on-rect branch March 15, 2022 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants