fix(Core/Grids): Crash fix (#22347)
This commit is contained in:
parent
92094eec01
commit
8dbde7a588
1 changed files with 2 additions and 2 deletions
|
|
@ -172,8 +172,8 @@ namespace Acore
|
|||
template<class RET_TYPE, int CENTER_VAL>
|
||||
inline RET_TYPE Compute(float x, float y, float size)
|
||||
{
|
||||
int gx = (int)(CENTER_VAL - x / size);
|
||||
int gy = (int)(CENTER_VAL - y / size);
|
||||
int gx = std::max<int>(0, (CENTER_VAL - x / size));
|
||||
int gy = std::max<int>(0, (CENTER_VAL - y / size));
|
||||
|
||||
return RET_TYPE(gx, gy);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue