mirror of
https://github.com/raysan5/raylib.git
synced 2026-04-23 23:33:58 -04:00
Update raygui.h
This commit is contained in:
@ -5128,11 +5128,11 @@ static const char *GetTextIcon(const char *text, int *iconId)
|
|||||||
|
|
||||||
// Get text divided into lines (by line-breaks '\n')
|
// Get text divided into lines (by line-breaks '\n')
|
||||||
// WARNING: It returns pointers to new lines but it does not add NULL ('\0') terminator!
|
// WARNING: It returns pointers to new lines but it does not add NULL ('\0') terminator!
|
||||||
static char **GetTextLines(const char *text, int *count)
|
static const char **GetTextLines(const char *text, int *count)
|
||||||
{
|
{
|
||||||
#define RAYGUI_MAX_TEXT_LINES 128
|
#define RAYGUI_MAX_TEXT_LINES 128
|
||||||
|
|
||||||
static char *lines[RAYGUI_MAX_TEXT_LINES] = { 0 };
|
static const char *lines[RAYGUI_MAX_TEXT_LINES] = { 0 };
|
||||||
for (int i = 0; i < RAYGUI_MAX_TEXT_LINES; i++) lines[i] = NULL; // Init NULL pointers to substrings
|
for (int i = 0; i < RAYGUI_MAX_TEXT_LINES; i++) lines[i] = NULL; // Init NULL pointers to substrings
|
||||||
|
|
||||||
int textLength = (int)strlen(text);
|
int textLength = (int)strlen(text);
|
||||||
@ -5202,7 +5202,7 @@ static void GuiDrawText(const char *text, Rectangle textBounds, int alignment, C
|
|||||||
// WARNING: GuiTextSplit() function can't be used now because it can have already been used
|
// WARNING: GuiTextSplit() function can't be used now because it can have already been used
|
||||||
// before the GuiDrawText() call and its buffer is static, it would be overriden :(
|
// before the GuiDrawText() call and its buffer is static, it would be overriden :(
|
||||||
int lineCount = 0;
|
int lineCount = 0;
|
||||||
char **lines = GetTextLines(text, &lineCount);
|
const char **lines = GetTextLines(text, &lineCount);
|
||||||
|
|
||||||
// Text style variables
|
// Text style variables
|
||||||
//int alignment = GuiGetStyle(DEFAULT, TEXT_ALIGNMENT);
|
//int alignment = GuiGetStyle(DEFAULT, TEXT_ALIGNMENT);
|
||||||
|
|||||||
Reference in New Issue
Block a user