* Fix a render bug in the TextInputBox

darn it
This commit is contained in:
iProgramInCpp
2023-07-31 11:33:15 +03:00
parent 3ccf62e613
commit 2631c262e6

View File

@@ -239,9 +239,9 @@ void TextInputBox::render()
int textYPos = (m_height - 8) / 2;
if (m_text.empty())
drawString(m_pFont, m_placeholder, m_xPos + 1, m_xPos + 1, 0x404040);
drawString(m_pFont, m_placeholder, m_xPos + 1, m_yPos + 1, 0x404040);
else
drawString(m_pFont, m_text, m_xPos + 1, m_xPos + textYPos, 0xFFFFFF);
drawString(m_pFont, m_text, m_xPos + 1, m_yPos + textYPos, 0xFFFFFF);
if (m_bCursorOn)
{
@@ -250,7 +250,7 @@ void TextInputBox::render()
std::string substr = m_text.substr(0, m_insertHead);
xPos += m_pFont->width(substr);
drawString(m_pFont, "_", m_xPos + xPos, m_xPos + textYPos + 1, 0xFFFFFF);
drawString(m_pFont, "_", m_xPos + xPos, m_yPos + textYPos + 1, 0xFFFFFF);
}
}