mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-31 19:29:19 -05:00
Review some logic
This commit is contained in:
@ -766,15 +766,11 @@ RAYGUIDEF bool GuiTextBoxEx(Rectangle bounds, char *text, int textSize, bool edi
|
|||||||
else selStart = selStart - guiTextBoxState.start;
|
else selStart = selStart - guiTextBoxState.start;
|
||||||
}
|
}
|
||||||
else state = GUI_STATE_FOCUSED;
|
else state = GUI_STATE_FOCUSED;
|
||||||
|
|
||||||
|
if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(0))) pressed = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (CheckCollisionPointRec(mousePoint, bounds))
|
|
||||||
{
|
|
||||||
state = GUI_STATE_FOCUSED;
|
|
||||||
if (IsMouseButtonPressed(0)) pressed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (active && IsKeyDown(KEY_LEFT_CONTROL) && IsKeyPressed(KEY_C))
|
if (active && IsKeyDown(KEY_LEFT_CONTROL) && IsKeyPressed(KEY_C))
|
||||||
{
|
{
|
||||||
// If active copy all text to clipboard even when disabled
|
// If active copy all text to clipboard even when disabled
|
||||||
@ -797,7 +793,16 @@ RAYGUIDEF bool GuiTextBoxEx(Rectangle bounds, char *text, int textSize, bool edi
|
|||||||
guiTextBoxState.cursor = cursor;
|
guiTextBoxState.cursor = cursor;
|
||||||
guiTextBoxState.start = start;
|
guiTextBoxState.start = start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CheckCollisionPointRec(mousePoint, bounds))
|
||||||
|
{
|
||||||
|
state = GUI_STATE_FOCUSED;
|
||||||
|
if (IsMouseButtonPressed(0)) pressed = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pressed) framesCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw control
|
// Draw control
|
||||||
|
|||||||
Reference in New Issue
Block a user