From 9097065ffe132ff176222aa080e561b45e505db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 22 Mar 2017 10:37:07 +0100 Subject: [PATCH] [escher] Fix bug due to type confusing Change-Id: I4a3072a69858b7fdee5215d80e4ce238612a5cd7 --- escher/src/text_field.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/escher/src/text_field.cpp b/escher/src/text_field.cpp index 982bb0497..ab743f27b 100644 --- a/escher/src/text_field.cpp +++ b/escher/src/text_field.cpp @@ -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(); }