Update raygui.h

This commit is contained in:
Ray 2024-04-07 09:47:54 +02:00
parent 0a9a9f897a
commit 0e96834a47

View File

@ -1327,7 +1327,7 @@ static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS*RAYGUI_ICON_DATA_ELEMENTS] =
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_255
};
// NOTE: We keep a pointer to the icons array, useful to point to other sets if required
// NOTE: A pointer to current icons array should be defined
static unsigned int *guiIconsPtr = guiIcons;
#endif // !RAYGUI_NO_ICONS && !RAYGUI_CUSTOM_ICONS
@ -3731,9 +3731,9 @@ int GuiMessageBox(Rectangle bounds, const char *title, const char *message, cons
int textWidth = GetTextWidth(message) + 2;
Rectangle textBounds = { 0 };
textBounds.x = bounds.x + bounds.width/2 - textWidth/2;
textBounds.x = bounds.x + RAYGUI_MESSAGEBOX_BUTTON_PADDING;
textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + RAYGUI_MESSAGEBOX_BUTTON_PADDING;
textBounds.width = (float)textWidth;
textBounds.width = bounds.width - RAYGUI_MESSAGEBOX_BUTTON_PADDING*2;
textBounds.height = bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - 3*RAYGUI_MESSAGEBOX_BUTTON_PADDING - RAYGUI_MESSAGEBOX_BUTTON_HEIGHT;
// Draw control
@ -5013,7 +5013,7 @@ static const char **GuiTextSplit(const char *text, char delimiter, int *count, i
buffer[i] = '\0'; // Set an end of string at this point
counter++;
if (counter == RAYGUI_TEXTSPLIT_MAX_ITEMS) break;
if (counter > RAYGUI_TEXTSPLIT_MAX_ITEMS) break;
}
}
@ -5175,7 +5175,7 @@ static int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue)
const int valueRange = maxValue - minValue;
int sliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE);
if (sliderSize < 1) sliderSize = 1;
if (sliderSize < 1) sliderSize = 1; // TODO: Consider a minimum slider size
// Calculate rectangles for all of the components
arrowUpLeft = RAYGUI_CLITERAL(Rectangle){