From 0280f973e5a7dda817e1a99b0e2b8bbef1b2ab47 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 22 Jan 2022 19:28:48 +0100 Subject: [PATCH] REVIEW: `GuiTextBox()`, avoid cursor out of box --- src/raygui.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/raygui.h b/src/raygui.h index ed1e03d..3084bd6 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -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 //--------------------------------------------------------------------