From b3f3a9fcc909665ffd91ff860466284a9571f323 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 18 Sep 2018 20:18:50 +0200 Subject: [PATCH] Corrected issue with grid bounds --- src/raygui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index 96fd755..5396802 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -3075,13 +3075,13 @@ RAYGUIDEF Vector2 GuiGrid(Rectangle bounds, int spacing, int subdivs, bool snap) // Draw vertical grid lines for (int i = 0; i < (bounds.width/spacing + 1)*subdivs; i++) { - DrawRectangle(bounds.y + spacing*i, 0, 1, bounds.height, ((i%subdivs) == 0) ? Fade(BLACK, GRID_COLOR_ALPHA*2) : Fade(GRAY, GRID_COLOR_ALPHA)); + DrawRectangle(bounds.x + spacing*i, bounds.y, 1, bounds.height, ((i%subdivs) == 0) ? Fade(BLACK, GRID_COLOR_ALPHA*2) : Fade(GRAY, GRID_COLOR_ALPHA)); } // Draw horizontal grid lines for (int i = 0; i < (bounds.height/spacing + 1)*subdivs; i++) { - DrawRectangle(0, bounds.x + spacing*i, bounds.width, 1, ((i%subdivs) == 0) ? Fade(BLACK, GRID_COLOR_ALPHA*2) : Fade(GRAY, GRID_COLOR_ALPHA)); + DrawRectangle(bounds.x, bounds.y + spacing*i, bounds.width, 1, ((i%subdivs) == 0) ? Fade(BLACK, GRID_COLOR_ALPHA*2) : Fade(GRAY, GRID_COLOR_ALPHA)); } } break; default: break;