From af5bccf1f1f12fa35504a1aa4e7bb0a1ab163113 Mon Sep 17 00:00:00 2001 From: Kunal Sinha Date: Sat, 22 Jun 2013 15:20:24 +0530 Subject: [PATCH] Fix for issue N_SE-41786 Change-Id: Icec0b26f026481eaf3afa23056b714e6b225029c Signed-off-by: Kunal Sinha --- src/ui/controls/FUiCtrl_EditPresenter.cpp | 41 ++++++++++++++++++++++++++----- src/ui/inc/FUiCtrl_EditPresenter.h | 2 ++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/ui/controls/FUiCtrl_EditPresenter.cpp b/src/ui/controls/FUiCtrl_EditPresenter.cpp index bef4b44..544ff9c 100755 --- a/src/ui/controls/FUiCtrl_EditPresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditPresenter.cpp @@ -236,6 +236,7 @@ _EditPresenter::_EditPresenter(void) , __columnCursorIndex(-1) , __isPasswordVisible(false) , __needToCreateCopyPastePopup(false) + , __calculatedCursorBounds(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) { } @@ -2760,7 +2761,14 @@ _EditPresenter::CalculateCursorBounds(const FloatRectangle& textBounds, FloatRec (cursorBounds.y < textBounds.y + textBounds.height)) { float cursorHeightDiff = cursorBounds.y + cursorBounds.height - textBounds.y - textBounds.height - 1.0f; - cursorBounds.height -= cursorHeightDiff; + if (cursorHeightDiff > 0.0f) + { + cursorBounds.height -= cursorHeightDiff; + } + else + { + cursorBounds.height += cursorHeightDiff; + } } if (__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) @@ -2815,7 +2823,7 @@ _EditPresenter::CalculateCursorBounds(const FloatRectangle& textBounds, FloatRec } } } - + __calculatedCursorBounds = cursorBounds; return E_SUCCESS; } @@ -2869,7 +2877,14 @@ _EditPresenter::CalculateCursorBounds(const FloatRectangle& textBounds, FloatRec (cursorBounds.y < textBounds.y + textBounds.height)) { float cursorHeightDiff = cursorBounds.y + cursorBounds.height - textBounds.y - textBounds.height - 1.0f; - cursorBounds.height -= cursorHeightDiff; + if (cursorHeightDiff > 0.0f) + { + cursorBounds.height -= cursorHeightDiff; + } + else + { + cursorBounds.height += cursorHeightDiff; + } } if (__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) @@ -2924,7 +2939,7 @@ _EditPresenter::CalculateCursorBounds(const FloatRectangle& textBounds, FloatRec } } } - + __calculatedCursorBounds = cursorBounds; return E_SUCCESS; } @@ -6456,7 +6471,14 @@ _EditPresenter::CalculateAbsoluteCursorBounds(int index, FloatRectangle& absCurs if (cursorHeight > 0.0f) { - absCursorBounds.height = cursorHeight; + if (cursorHeight <= __calculatedCursorBounds.height) + { + absCursorBounds.height = cursorHeight; + } + else + { + absCursorBounds.height = __calculatedCursorBounds.height; + } } else { @@ -6502,7 +6524,14 @@ _EditPresenter::CalculateAbsoluteCursorBounds(int rowIndex, int columnIndex, Flo if (cursorHeight > 0.0f) { - absCursorBounds.height = cursorHeight; + if (cursorHeight <= __calculatedCursorBounds.height) + { + absCursorBounds.height = cursorHeight; + } + else + { + absCursorBounds.height = __calculatedCursorBounds.height; + } } else { diff --git a/src/ui/inc/FUiCtrl_EditPresenter.h b/src/ui/inc/FUiCtrl_EditPresenter.h index 9b03627..6504935 100755 --- a/src/ui/inc/FUiCtrl_EditPresenter.h +++ b/src/ui/inc/FUiCtrl_EditPresenter.h @@ -582,6 +582,8 @@ private: int __columnCursorIndex; bool __isPasswordVisible; bool __needToCreateCopyPastePopup; + FloatRectangle __calculatedCursorBounds; + }; // _EditPresenter }}} // Tizen::Ui::Controls -- 2.7.4