From 5f40cf3ae6276687b55e6f5d52af2e60e084fe89 Mon Sep 17 00:00:00 2001 From: Bruno Van de Velde Date: Wed, 4 Oct 2017 18:51:53 +0200 Subject: [PATCH] :sparkles: EditBox and TextBox should always set a caret width, even when a default theme is used that doesn't specify one --- include/TGUI/Widgets/EditBox.hpp | 2 +- include/TGUI/Widgets/TextBox.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/TGUI/Widgets/EditBox.hpp b/include/TGUI/Widgets/EditBox.hpp index 9510fea3..c270cfab 100644 --- a/include/TGUI/Widgets/EditBox.hpp +++ b/include/TGUI/Widgets/EditBox.hpp @@ -560,7 +560,7 @@ namespace tgui FloatRect m_selectedTextBackground; // The blinking caret - FloatRect m_caret; + FloatRect m_caret = {{0, 0, 1, 0}}; // Is there a possibility that the user is going to double click? bool m_possibleDoubleClick = false; diff --git a/include/TGUI/Widgets/TextBox.hpp b/include/TGUI/Widgets/TextBox.hpp index cd0e774f..abc7b438 100644 --- a/include/TGUI/Widgets/TextBox.hpp +++ b/include/TGUI/Widgets/TextBox.hpp @@ -488,7 +488,7 @@ namespace tgui Color m_backgroundColorCached; Color m_caretColorCached; Color m_selectedTextBackgroundColorCached; - float m_caretWidthCached = 0; + float m_caretWidthCached = 1; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// };