mirror of
https://github.com/raysan5/raygui.git
synced 2026-04-10 01:09:11 -04:00
Update raygui.h
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raygui v5.0-dev - A simple and easy-to-use immediate-mode gui library
|
* raygui v5.0 - A simple and easy-to-use immediate-mode gui library
|
||||||
*
|
*
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
* raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also
|
* raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also
|
||||||
@ -1096,11 +1096,11 @@ typedef enum {
|
|||||||
|
|
||||||
#if defined(RAYGUI_IMPLEMENTATION)
|
#if defined(RAYGUI_IMPLEMENTATION)
|
||||||
|
|
||||||
#include <ctype.h> // required for: isspace() [GuiTextBox()]
|
|
||||||
#include <stdio.h> // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), snprintf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()]
|
#include <stdio.h> // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), snprintf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()]
|
||||||
#include <string.h> // Required for: strlen() [GuiTextBox(), GuiValueBox()], memset(), memcpy()
|
#include <string.h> // Required for: strlen() [GuiTextBox(), GuiValueBox()], memset(), memcpy()
|
||||||
#include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end() [TextFormat()]
|
#include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end() [TextFormat()]
|
||||||
#include <math.h> // Required for: roundf() [GuiColorPicker()]
|
#include <math.h> // Required for: roundf() [GuiColorPicker()]
|
||||||
|
#include <ctype.h> // Required for: isspace() [GuiTextBox()]
|
||||||
|
|
||||||
// Allow custom memory allocators
|
// Allow custom memory allocators
|
||||||
#if defined(RAYGUI_MALLOC) || defined(RAYGUI_CALLOC) || defined(RAYGUI_FREE)
|
#if defined(RAYGUI_MALLOC) || defined(RAYGUI_CALLOC) || defined(RAYGUI_FREE)
|
||||||
@ -2718,7 +2718,6 @@ int GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode)
|
|||||||
|
|
||||||
textLength -= accCodepointSize;
|
textLength -= accCodepointSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ((textLength > textBoxCursorIndex) && (GUI_KEY_PRESSED(KEY_DELETE) || (GUI_KEY_DOWN(KEY_DELETE) && autoCursorShouldTrigger)))
|
else if ((textLength > textBoxCursorIndex) && (GUI_KEY_PRESSED(KEY_DELETE) || (GUI_KEY_DOWN(KEY_DELETE) && autoCursorShouldTrigger)))
|
||||||
{
|
{
|
||||||
// Delete single codepoint from text, after current cursor position
|
// Delete single codepoint from text, after current cursor position
|
||||||
@ -2768,7 +2767,6 @@ int GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode)
|
|||||||
textLength -= accCodepointSize;
|
textLength -= accCodepointSize;
|
||||||
textBoxCursorIndex -= accCodepointSize;
|
textBoxCursorIndex -= accCodepointSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ((textBoxCursorIndex > 0) && (GUI_KEY_PRESSED(KEY_BACKSPACE) || (GUI_KEY_DOWN(KEY_BACKSPACE) && autoCursorShouldTrigger)))
|
else if ((textBoxCursorIndex > 0) && (GUI_KEY_PRESSED(KEY_BACKSPACE) || (GUI_KEY_DOWN(KEY_BACKSPACE) && autoCursorShouldTrigger)))
|
||||||
{
|
{
|
||||||
// Delete single codepoint from text, before current cursor position
|
// Delete single codepoint from text, before current cursor position
|
||||||
@ -5393,7 +5391,8 @@ static void GuiDrawText(const char *text, Rectangle textBounds, int alignment, C
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (wrapMode == TEXT_WRAP_NONE) posOffsetY += (float)(GuiGetStyle(DEFAULT, TEXT_SIZE) + GuiGetStyle(DEFAULT, TEXT_LINE_SPACING));
|
if (wrapMode == TEXT_WRAP_NONE) posOffsetY += (float)(GuiGetStyle(DEFAULT, TEXT_SIZE) + GuiGetStyle(DEFAULT, TEXT_LINE_SPACING));
|
||||||
else if ((wrapMode == TEXT_WRAP_CHAR) || (wrapMode == TEXT_WRAP_WORD)) posOffsetY += (textOffsetY + (float)GuiGetStyle(DEFAULT, TEXT_LINE_SPACING));
|
else if ((wrapMode == TEXT_WRAP_CHAR) || (wrapMode == TEXT_WRAP_WORD))
|
||||||
|
posOffsetY += (textOffsetY + GuiGetStyle(DEFAULT, TEXT_SIZE));
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user