fix(Core/Grids): Crash fix (#22347)
This commit is contained in:
@@ -172,8 +172,8 @@ namespace Acore
|
|||||||
template<class RET_TYPE, int CENTER_VAL>
|
template<class RET_TYPE, int CENTER_VAL>
|
||||||
inline RET_TYPE Compute(float x, float y, float size)
|
inline RET_TYPE Compute(float x, float y, float size)
|
||||||
{
|
{
|
||||||
int gx = (int)(CENTER_VAL - x / size);
|
int gx = std::max<int>(0, (CENTER_VAL - x / size));
|
||||||
int gy = (int)(CENTER_VAL - y / size);
|
int gy = std::max<int>(0, (CENTER_VAL - y / size));
|
||||||
|
|
||||||
return RET_TYPE(gx, gy);
|
return RET_TYPE(gx, gy);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user