-
-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure
Rectf
width and height never go below 0
Previously, assertion in two of the initializers of `Rectf` was put in place, which checked if the rectangle has been initialized with negative width or height. It was discovered that the assertion causes problems. If a hitbox has a width or height of 0, and is grown with a negative value as `border`. The newly initialized `Rectf` in the function would have negative width or height, so the game crashes on Debug builds, because of the assertions put in place. The checks are now performed using `if` statements, and if the width or height go below 0, they are set to 0. Additionally, these checks are also implemented in the width, height and size setters of `Rectf`.
- Loading branch information
1 parent
ecb9350
commit d232695
Showing
2 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters