Update raygui.h

This commit is contained in:
Ray
2023-05-31 18:14:04 +02:00
parent d72e70b410
commit 37deba27a8

View File

@ -1942,7 +1942,7 @@ int GuiToggleGroup(Rectangle bounds, const char *text, int *active)
int result = 0;
float initBoundsX = bounds.x;
bool temp = false;
int temp = 0;
if (active == NULL) active = &temp;
bool toggle = false; // Required for individual toggles
@ -2302,7 +2302,7 @@ int GuiTextBox(Rectangle bounds, char *text, int bufferSize, bool editMode)
textWidth = GetTextWidth(text + textIndexOffset) - GetTextWidth(text + textBoxCursorIndex);
}
int textLength = (int)strlen(text); // Get current text length
unsigned int textLength = (unsigned int)strlen(text); // Get current text length
int codepoint = GetCharPressed(); // Get Unicode codepoint
if (multiline && IsKeyPressed(KEY_ENTER)) codepoint = (int)'\n';
@ -2394,7 +2394,7 @@ int GuiTextBox(Rectangle bounds, char *text, int bufferSize, bool editMode)
if (IsKeyPressed(KEY_LEFT) || (autoCursorDelayCounter%RAYGUI_TEXTBOX_AUTO_CURSOR_DELAY) == 0) // Delay every movement some frames
{
int prevCodepointSize = 0;
unsigned int prevCodepointSize = 0;
GetCodepointPrevious(text + textBoxCursorIndex, &prevCodepointSize);
if (textBoxCursorIndex >= prevCodepointSize) textBoxCursorIndex -= prevCodepointSize;
@ -2439,7 +2439,7 @@ int GuiTextBox(Rectangle bounds, char *text, int bufferSize, bool editMode)
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
{
textBoxCursorIndex = strlen(text); // GLOBAL: Place cursor index to the end of current text
textBoxCursorIndex = (int)strlen(text); // GLOBAL: Place cursor index to the end of current text
result = 1;
}
}
@ -4362,7 +4362,7 @@ static void GuiTooltip(Rectangle controlRec)
{
if (!guiLocked && guiTooltip && (guiTooltipPtr != NULL) && !guiSliderDragging)
{
Vector2 textSize = MeasureTextEx(GuiGetFont(), guiTooltipPtr, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING));
Vector2 textSize = MeasureTextEx(GuiGetFont(), guiTooltipPtr, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING));
if ((controlRec.x + textSize.x + 16) > GetScreenWidth()) controlRec.x -= (textSize.x + 16 - controlRec.width);