Update raygui.h

This commit is contained in:
raysan5 2021-12-29 20:04:18 +01:00
parent 771513ebe5
commit e12b1f93c3

View File

@ -3272,8 +3272,9 @@ Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs)
{
if (CheckCollisionPointRec(mousePoint, bounds))
{
currentCell.x = (mousePoint.x - bounds.x)/spacing;
currentCell.y = (mousePoint.y - bounds.y)/spacing;
// NOTE: Cell values must be rounded to int
currentCell.x = (int)((mousePoint.x - bounds.x)/spacing);
currentCell.y = (int)((mousePoint.y - bounds.y)/spacing);
}
}
//--------------------------------------------------------------------