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

Horizontal and vertical flip #262

Open
fossegutten opened this issue May 11, 2021 · 1 comment
Open

Horizontal and vertical flip #262

fossegutten opened this issue May 11, 2021 · 1 comment
Labels
Area: Graphics Issues related to graphics/rendering. Type: Feature Request Improvements that could be made to the code/documentation.

Comments

@fossegutten
Copy link

fossegutten commented May 11, 2021

Summary:
Add booleans for horizontal and vertical flip to DrawParams, that does not offset the textures.
This would be nice because scaling in negative direction also offsets the texture in the negative direction.
As a workaround to avoid this, we need to add half texture size to position and to origin.

Steps to reproduce:

DrawParams::default()
                .position(some_position)
                .scale(Vec2::new(-1.0, -1.0))

Texture now moved up and to the left.

Expected behavior:
Expected the texture to draw at some_position, just mirrored.

Additional info:

@fossegutten fossegutten added the Type: Bug Problems with the code/documentation that need to be fixed. label May 11, 2021
@17cupsofcoffee 17cupsofcoffee added Type: Feature Request Improvements that could be made to the code/documentation. Area: Graphics Issues related to graphics/rendering. and removed Type: Bug Problems with the code/documentation that need to be fixed. labels May 11, 2021
@17cupsofcoffee
Copy link
Owner

This definitely does seem like something worth adding (XNA has it via SpriteEffects). I'd just need to figure out if there's a way to do it without a breaking change - because DrawParams has pub fields and no non_exhaustive annotation, it could break people's code if I added a new field (but it might be minor enough to be worth it).

@17cupsofcoffee 17cupsofcoffee mentioned this issue Nov 10, 2021
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Graphics Issues related to graphics/rendering. Type: Feature Request Improvements that could be made to the code/documentation.
Projects
None yet
Development

No branches or pull requests

2 participants