[escher] Fix bug due to type confusing

Change-Id: I4a3072a69858b7fdee5215d80e4ce238612a5cd7
This commit is contained in:
Émilie Feral
2017-03-22 10:37:07 +01:00
parent ce48cd1859
commit 9097065ffe

View File

@@ -115,9 +115,9 @@ void TextField::ContentView::reinitDraftTextBuffer() {
}
void TextField::ContentView::setCursorLocation(int location) {
location = location < 0 ? 0 : location;
location = location > (signed char)m_currentTextLength ? m_currentTextLength : location;
m_currentCursorLocation = location;
int adjustedLocation = location < 0 ? 0 : location;
adjustedLocation = adjustedLocation > (signed int)m_currentTextLength ? (signed int)m_currentTextLength : adjustedLocation;
m_currentCursorLocation = adjustedLocation;
layoutSubviews();
}