From d8b1d3a6702cf9d49a755c4515769da451ec5219 Mon Sep 17 00:00:00 2001 From: Bruno Van de Velde Date: Fri, 18 Aug 2017 16:08:29 +0200 Subject: [PATCH] Default text in edit box was not positioned correctly with center or right alignment --- src/TGUI/Widgets/EditBox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TGUI/Widgets/EditBox.cpp b/src/TGUI/Widgets/EditBox.cpp index 432fa6c2..f85d9d13 100644 --- a/src/TGUI/Widgets/EditBox.cpp +++ b/src/TGUI/Widgets/EditBox.cpp @@ -1210,7 +1210,7 @@ namespace tgui if (m_textAlignment != Alignment::Left) { // Calculate the text width - const float textWidth = m_textFull.getSize().x; + const float textWidth = m_textFull.getString().isEmpty() ? m_defaultText.getSize().x : m_textFull.getSize().x; // Check if a layout would make sense if (textWidth < getVisibleEditBoxWidth())