mirror of
https://github.com/raysan5/raygui.git
synced 2026-02-05 21:59:18 -05:00
GuiGrid() Corrected issue with div by 0
This commit is contained in:
@ -2900,6 +2900,8 @@ Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs)
|
|||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case GUI_STATE_NORMAL:
|
case GUI_STATE_NORMAL:
|
||||||
|
{
|
||||||
|
if (subdivs > 0)
|
||||||
{
|
{
|
||||||
// Draw vertical grid lines
|
// Draw vertical grid lines
|
||||||
for (int i = 0; i < linesV; i++)
|
for (int i = 0; i < linesV; i++)
|
||||||
@ -2912,7 +2914,7 @@ Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs)
|
|||||||
{
|
{
|
||||||
DrawRectangleRec(RAYGUI_CLITERAL(Rectangle) { bounds.x, bounds.y + spacing * i / subdivs, bounds.width, 1 }, ((i%subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA * 4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA));
|
DrawRectangleRec(RAYGUI_CLITERAL(Rectangle) { bounds.x, bounds.y + spacing * i / subdivs, bounds.width, 1 }, ((i%subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA * 4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user