From 4925bbabe88049e20621b961bc391eff64d26090 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 11 Apr 2019 00:19:12 +0200 Subject: [PATCH] Added note --- src/raygui.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/raygui.h b/src/raygui.h index 4666641..fb824cb 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -1574,7 +1574,6 @@ RAYGUIDEF bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editM if (editMode) { state = GUI_STATE_PRESSED; - framesCounter++; int key = GetKeyPressed(); @@ -1639,6 +1638,9 @@ RAYGUIDEF bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editM if (state == GUI_STATE_PRESSED) { DrawRectangle(bounds.x + GuiGetStyle(TEXTBOX, BORDER_WIDTH), bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH), bounds.width - 2*GuiGetStyle(TEXTBOX, BORDER_WIDTH), bounds.height - 2*GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_FOCUSED)), guiAlpha)); + + // Draw blinking cursor + // TODO: Consider TEXTBOX TEXT_ALIGNMENT if (editMode && ((framesCounter/20)%2 == 0)) DrawRectangle(bounds.x + GuiGetStyle(TEXTBOX, INNER_PADDING) + GetTextWidth(text) + 2, bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE), 1, GuiGetStyle(DEFAULT, TEXT_SIZE)*2, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); } else if (state == GUI_STATE_DISABLED)