Interrupt / delverengine

Delver game engine and editor
zlib License
801 stars 78 forks source link

Fix 0 scale on text bug that crash the game #312

Closed GianptDev closed 1 year ago

GianptDev commented 1 year ago

Hi, I've noticed that when the game window is scaled with a very small size the math used to resize text elements set their scale to 0.

Gdx seem to not allow that and crash the game.

I've found a bug on Windows (not sure if the same on other platforms) that happen when the game window is minimized, somewhat the game forget his window size and tries to scale, as said before, elements with 0 as a scale.

The change I've made was simply a check to stop rendering when the given scale for text is 0, seem to work.