FlxGridOverlay: Prevent freeze when passing invalid cell size values#462
Conversation
|
I'm not familiar with this class, is there an example usage somewhere? Also, does it make sense to throw or log an error in this case? My immediate thought is to throw, since logs won't be seen until the next update, which may be after some other call already caused an error or infinite loop |
|
Also, I don't recommend using this class, lol. this seems outdated and optimized for Flash rather than renderTile targets. I'm still okay with the PR, but yeah I think this class should be replaced and deprecated |
This returns an FlxSprite the size of the game with a grid graphic that has 10x10 sized cells.
Yeah throwing is likely better here |
Passing in 0 or a negative number (in my case due to a bad calculation) when creating a grid overlay caused the while loops in
createGrid()to never exit because x/y would always be smaller than width/heightflixel-addons/flixel/addons/display/FlxGridOverlay.hx
Line 112 in cff2640