REVIEW: GuiTextBox(), avoid cursor out of box

This commit is contained in:
raysan5
2022-01-22 19:28:48 +01:00
parent 679cc2f17f
commit 0280f973e5

View File

@ -1974,6 +1974,7 @@ bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode)
};
if (cursor.height > bounds.height) cursor.height = bounds.height - GuiGetStyle(TEXTBOX, BORDER_WIDTH)*2;
if (cursor.y < (bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH))) cursor.y = bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH);
// Update control
//--------------------------------------------------------------------