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

Negative scaleX/scaleY breaks GetTextureRectRelativeToContainer() #215

Open
wongjustin99 opened this issue Nov 20, 2013 · 2 comments
Open

Comments

@wongjustin99
Copy link

When a negative scaleX/scaleY is used, GetTextureRectRelativeToContainer() breaks.

I was able to fix this by wrapping the scaleX and scaleY in Math.Abs(), but I'm wondering if there's a better way to mirror an FSprite besides that, or if it just doesn't make sense to have negative scaleX/scaleY.

wongjustin99 added a commit to wongjustin99/PossyFerry that referenced this issue Nov 20, 2013
`Player` wasn't having hit detection because of the mirrored `scaleX`.

It might be a bug in Futile, so I just modified the
`GetTextureRectRelativeToContainer()` method in order to "fix" it. An
issue has been filed
[here](MattRix/Futile#215).
@MattRix
Copy link
Owner

MattRix commented Nov 20, 2013

Hmm, yeah negative scaleX and scaleY is the intended way to flip a sprite. The actual issue here is caused by the fact that most rect contains/intersection algorithms don't handle negative rect widths and heights. Futile has a built in extra rect extension called rect.CheckIntersectComplex(otherRect) that's meant for dealing with that though.

@wongjustin99
Copy link
Author

That worked great, thanks!

wongjustin99 added a commit to wongjustin99/PossyFerry that referenced this issue Nov 21, 2013
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

No branches or pull requests

2 participants