mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -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 state = GUI_STATE_FOCUSED;
|
||||
|
||||
if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(0))) pressed = true;
|
||||
}
|
||||
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 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.start = start;
|
||||
}
|
||||
|
||||
if (CheckCollisionPointRec(mousePoint, bounds))
|
||||
{
|
||||
state = GUI_STATE_FOCUSED;
|
||||
if (IsMouseButtonPressed(0)) pressed = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (pressed) framesCounter = 0;
|
||||
}
|
||||
|
||||
// Draw control
|
||||
|
||||
Reference in New Issue
Block a user