mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-27 01:19:18 -05:00
Have GuiTextBox/GuiTextBoxMulti respect BORDER_WIDTH (#260)
GuiTextBox and GuiTextBoxMulti's focused and pressed state respect the BORDER_WIDTH style setting, however in normal state this was hard coded to 1. This change now allows users control over the borders when in a normal state.
This commit is contained in:
@ -2166,7 +2166,7 @@ bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode)
|
|||||||
{
|
{
|
||||||
GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha));
|
GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha));
|
||||||
}
|
}
|
||||||
else GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), BLANK);
|
else GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), BLANK);
|
||||||
|
|
||||||
if (editMode)
|
if (editMode)
|
||||||
{
|
{
|
||||||
@ -2477,7 +2477,7 @@ bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode)
|
|||||||
{
|
{
|
||||||
GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha));
|
GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha));
|
||||||
}
|
}
|
||||||
else GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), BLANK);
|
else GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), BLANK);
|
||||||
|
|
||||||
int wrapMode = 1; // 0-No wrap, 1-Char wrap, 2-Word wrap
|
int wrapMode = 1; // 0-No wrap, 1-Char wrap, 2-Word wrap
|
||||||
Vector2 cursorPos = { textAreaBounds.x, textAreaBounds.y };
|
Vector2 cursorPos = { textAreaBounds.x, textAreaBounds.y };
|
||||||
|
|||||||
Reference in New Issue
Block a user