From c16a98365fbe9358b7d873b5148319c781309bad Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 7 Nov 2022 13:19:53 +0100 Subject: [PATCH] REVERTED: `GuiGrid()` cell compute, returning value was not right It was validated on `rGuiIcons()`, returned value was not correct --- src/raygui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index c80a6d8..a118dbe 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -3284,8 +3284,8 @@ Vector2 GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs) if (CheckCollisionPointRec(mousePoint, bounds)) { // NOTE: Cell values must be rounded to int - currentCell.x = roundf((mousePoint.x - bounds.x)/spacing); - currentCell.y = roundf((mousePoint.y - bounds.y)/spacing); + currentCell.x = (float)((int)((mousePoint.x - bounds.x)/spacing)); + currentCell.y = (float)((int)((mousePoint.y - bounds.y)/spacing)); } } //--------------------------------------------------------------------