-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Exception when creating ProgressBar #106
Comments
I can't reproduce this. I tried it on both windows and linux but it just works without any error. |
Not good, tests fail too, log:
P.S. I use VS2019 on Win10. |
Maybe this is a problem related to VS2019. I can't test that right now unfortunately (as I just started with completely reinstalling my PC today). It also looks like AppVeyor doesn't support VS2019 yet. Did you build both SFML and TGUI yourself with the exact compiler that you are using? |
Yes, I built both libraries with this same compiler. Maybe it's really a problem with VS2019, unfortunately I can't downgrade it. |
This sounds more like a limitation of GPU as in, it only supports small-ish texture sizes. What's your GPU? What version of SFML are you on? @texus what font does TGUI use? And is that an error from TGUI itself? |
TGUI uses DejaVuSans (stored as an unsigned char[] in the code which gets passed to sf::Font::loadFromMemory). It isn't a TGUI exception, I have never encountered it before. |
I don't think so because all other widgets created without problem. I tried to debug the issue and found that for some reason when progress bar is set renderer variable |
The character size is always initialized in sf::Text, so either setCharacterSize was called with an invalid value or the entire tgui::Text object that contains the sf::Text object is already invalid. Neither seem very likely to me. I just got a clean Windows 10 with VS2019 working and it doesn't crash for me. The tests all pass. I do get the OpenGL error in the tests, but this happens somewhere in Picture.cpp so it doesn't look related. Double check to make sure that the SFML and TGUI libraries are compatible (the SFML libs used in your project must be the exact same ones as the ones that were found by cmake when building TGUI, you can't even mix release and debug files). If you are certain that the libraries are compatible then maybe you could try debugging the code some more by e.g. printing the parameter in Text::setCharacterSize. |
No, I am definitely sure it's not about library compatibilities. I investigated it a bit more and found that innerSize at this point has negative value, result of next expression become negative infinum what obvious can't give good result after casting. So I just added checking: |
Thanks for debugging and finding the issue, I'll fix it I was looking in that function earlier, trying to find some case where Text::findBestTextSize could possibly give a negative number, but I didn't realize there was another setCharacterSize call just a few lines below. |
MCVE(also can be reproduced in sample Many different widgets):
Log:
The text was updated successfully, but these errors were encountered: