Right clicking outside the textbox bounds will deactivate it

This commit is contained in:
Demizdor
2019-05-11 11:18:40 +03:00
parent 5c54c464d0
commit c146b2d950

View File

@ -2041,6 +2041,12 @@ RAYGUIDEF bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editM
GuiTextBoxSetActive(bounds);
}
}
else if(!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_RIGHT_BUTTON))
{
// When active and the right mouse is clicked outside the textbox we should deactivate it
GuiTextBoxSetActive((Rectangle){0,0,-1,-1}); // Set a dummy rect as the active textbox bounds
active = false;
}
if(active)
{