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

Fixed loadRotatedGraphic to solve Mod by 0 #2518

Merged
merged 1 commit into from
Apr 13, 2022
Merged

Fixed loadRotatedGraphic to solve Mod by 0 #2518

merged 1 commit into from
Apr 13, 2022

Conversation

SeiferTim
Copy link
Member

Would happen if using a single-frame graphic image.

Error occurred only on Windows targets that I could see - not HashLink, or HTML5.

Would happen if using a single-frame graphic image.

Error occurred *only* on Windows targets that I could see - not HashLink, or HTML5.
@Geokureli
Copy link
Member

sorry, forgot to circle back on this. Wouldn't framesNum only be 0 if the image is smaller than the frameWidth? Should we log an an error in this case? perhaps I'm not understanding, can you give me a repro to try?

@SeiferTim
Copy link
Member Author

Sorry, I don't see these notifications very often - they are usually buried in about 10k that have nothing to do with me...

I'm not 100% sure of what the actual problem is, I'm using it like this:

sprite.loadRotatedGraphic('assets/images/Graphic.png', 180, 0, false, true, '${Graphic}-rotated');

...and it just dies on Windows targets, not on Hashlink/HTML5.
Changing the code to what I committed fixed it.

In my case, my Graphic.png is an image that is 10x24px and I want to use the whole image (frame 0) and generate rotations...

@Geokureli
Copy link
Member

I wanna double-check that this isn't the symptom of some other issue, can you give me the dimensions of Graphic.png?

@SeiferTim
Copy link
Member Author

10x24px

@Geokureli Geokureli merged commit 68d26b2 into HaxeFlixel:dev Apr 13, 2022
@Geokureli
Copy link
Member

Sorry this took forever, I just wanted to make sure I understood the problem

@SeiferTim SeiferTim deleted the patch-4 branch April 15, 2022 12:13
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