From: Kunal Sinha Date: Sat, 22 Jun 2013 09:50:24 +0000 (+0530) Subject: Fix for issue N_SE-41786 X-Git-Tag: accepted/tizen/20130924.144426~1^2~358^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af5bccf1f1f12fa35504a1aa4e7bb0a1ab163113;p=platform%2Fframework%2Fnative%2Fuifw.git Fix for issue N_SE-41786 Change-Id: Icec0b26f026481eaf3afa23056b714e6b225029c Signed-off-by: Kunal Sinha --- 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