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

feat: method componentsAtPoint now reports the "stacktrace" of points #1615

Merged
merged 7 commits into from
May 17, 2022

Conversation

st-pasha
Copy link
Contributor

Description

The method componentsAtPoint now has an optional parameter nestedPoints, which will record the "stacktrace" of points up to and including the currently returned component. This allows for better flexibility in understanding the point's position relative to its parent and the world. This also allows the method componentsAtPoint to return an iterable of Components instead of an iterable of ComponentPointPairs.

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.
    • There is a change in the API of componentsAtPoint(). However, since the method itself was only introduced 2 weeks ago (feat: Added componentsAtPoint() iterable #1518), and there hasn't been a Flame release since then, the change can be considered non-breaking.

Related Issues

Closes #1592

/// element in the list is the point in the coordinate space of the returned
/// component, the element before the last is in that component's parent's
/// coordinate space, and so on. The [nestedPoints] list must be growable and
/// modifiable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list must be growable and modifiable

Can't we clone the list to avoid this type of side effect? Or does this gives a huge impact on perfomance?

If so, we could at least clone at on the first call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an output parameter, so the entire idea is that the list will be modified by the function so that the user would then be able to look at it.

@wolfenrain wolfenrain changed the title feat: Method componentsAtPoint now reports the "stacktrace" of points feat: method componentsAtPoint now reports the "stacktrace" of points May 11, 2022
Copy link
Contributor

@wolfenrain wolfenrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love that this removes the ComponentPointPair class, but this means it is a breaking change right?

@spydon
Copy link
Member

spydon commented May 11, 2022

Love that this removes the ComponentPointPair class, but this means it is a breaking change right?

It's not, because we haven't released those changes. :)

Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very happy that the ComponentPointPair, good job!

@spydon spydon merged commit e239896 into flame-engine:main May 17, 2022
@st-pasha st-pasha deleted the components-at-point branch May 17, 2022 20:09
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.

Improve API of componentsAtPoint()
4 participants