mirror of
https://github.com/raysan5/raygui.git
synced 2026-02-01 11:49:18 -05:00
Corrected issue with grid bounds
This commit is contained in:
@ -3075,13 +3075,13 @@ RAYGUIDEF Vector2 GuiGrid(Rectangle bounds, int spacing, int subdivs, bool snap)
|
|||||||
// Draw vertical grid lines
|
// Draw vertical grid lines
|
||||||
for (int i = 0; i < (bounds.width/spacing + 1)*subdivs; i++)
|
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
|
// Draw horizontal grid lines
|
||||||
for (int i = 0; i < (bounds.height/spacing + 1)*subdivs; i++)
|
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;
|
} break;
|
||||||
default: break;
|
default: break;
|
||||||
|
|||||||
Reference in New Issue
Block a user