-
-
Notifications
You must be signed in to change notification settings - Fork 934
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: Helpers for whether a PositionComponent
is flipped.
#1700
Conversation
component.flipHorizontallyAroundCenter(); | ||
expect(component.isFlippedHorizontally, isTrue); | ||
component.flipHorizontallyAroundCenter(); | ||
expect(component.isFlippedHorizontally, isFalse); |
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 wonder what happens if "flip" with one version and "unflip" with the other
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 think that it will move the component from its original position (which I think makes sense), if I remember correctly this is documented somewhere, maybe on the dartdocs.
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.
Nice!
/// Whether it is currently flipped horizontally. | ||
bool get isFlippedHorizontally => transform.scale.x.isNegative; | ||
|
||
/// Whether it is currently flipped horizontally. |
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.
Vertically
Related issue #1336 |
Description
Helpers that just check if the scale is negative so that the user can now whether the component has been flipped.
Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
.Breaking Change
Related Issues
Closes #1336