mirror of
https://github.com/raysan5/raygui.git
synced 2026-10-12 20:51:54 -04:00
Compare commits
3 Commits
47066b1b9f
...
04bf996730
| Author | SHA1 | Date | |
|---|---|---|---|
| 04bf996730 | |||
| 386297a48d | |||
| 6fcd57bfe5 |
11
src/raygui.h
11
src/raygui.h
@ -2697,7 +2697,7 @@ int GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode)
|
|||||||
if (pasteLength > 0)
|
if (pasteLength > 0)
|
||||||
{
|
{
|
||||||
// Move forward data from cursor position
|
// Move forward data from cursor position
|
||||||
for (int i = textLength + pasteLength; i > textBoxCursorIndex; i--) text[i] = text[i - pasteLength];
|
for (int i = textLength + pasteLength; (i > textBoxCursorIndex) && (i < pasteLength); i--) text[i] = text[i - pasteLength];
|
||||||
|
|
||||||
// Paste data in at cursor
|
// Paste data in at cursor
|
||||||
for (int i = 0; i < pasteLength; i++) text[textBoxCursorIndex + i] = pasteText[i];
|
for (int i = 0; i < pasteLength; i++) text[textBoxCursorIndex + i] = pasteText[i];
|
||||||
@ -3958,8 +3958,9 @@ int GuiTabBarEx(Rectangle bounds, char **text, int count, int *hscroll, int *act
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw tab-bar bottom line
|
// Draw tab-bar border line
|
||||||
GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height - 1, bounds.width, 1 }, 0, BLANK, GetColor(GuiGetStyle(TABBAR, BORDER_COLOR_NORMAL)));
|
float tabBorderOffset = (GuiGetStyle(TABBAR, TAB_LINE_SIDE) == 1)? 0 : (bounds.height - 1);
|
||||||
|
GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + tabBorderOffset, bounds.width, 1 }, 0, BLANK, GetColor(GuiGetStyle(TABBAR, BORDER_COLOR_NORMAL)));
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
// NOTE: In case of tab close result, consider focused tab
|
// NOTE: In case of tab close result, consider focused tab
|
||||||
@ -5783,7 +5784,7 @@ static void GuiDrawRectangle(Rectangle rec, int borderWidth, Color borderColor,
|
|||||||
// TODO: Consider multiline text
|
// TODO: Consider multiline text
|
||||||
static Vector2 GuiMeasureText(const char *text)
|
static Vector2 GuiMeasureText(const char *text)
|
||||||
{
|
{
|
||||||
Vector2 size = { 0 };
|
Vector2 textSize = { 0 };
|
||||||
|
|
||||||
if ((guiFont.texture.id > 0) && (text != NULL))
|
if ((guiFont.texture.id > 0) && (text != NULL))
|
||||||
{
|
{
|
||||||
@ -5811,7 +5812,7 @@ static Vector2 GuiMeasureText(const char *text)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return size;
|
return textSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw tooltip using control bounds
|
// Draw tooltip using control bounds
|
||||||
|
|||||||
Reference in New Issue
Block a user