mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[escher] Fix bug in text field
Change-Id: Ia77786c449de89d3155bfdba6e873f9d6dd5b901
This commit is contained in:
@@ -77,7 +77,8 @@ int TextField::ContentView::bufferSize() {
|
||||
void TextField::ContentView::setText(const char * text) {
|
||||
if (m_isEditing) {
|
||||
strlcpy(m_draftTextBuffer, text, m_textBufferSize);
|
||||
m_currentTextLength = strlen(text);
|
||||
int textLength = strlen(text) >= m_textBufferSize ? m_textBufferSize-1 : strlen(text);
|
||||
m_currentTextLength = textLength;
|
||||
} else {
|
||||
strlcpy(m_textBuffer, text, m_textBufferSize);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user