fixed bug (N_SE-39368,N_SE-39413)
authorChulheon <ch.jeong47@samsung.com>
Thu, 23 May 2013 06:12:45 +0000 (15:12 +0900)
committerChulheon <ch.jeong47@samsung.com>
Thu, 23 May 2013 06:12:45 +0000 (15:12 +0900)
Change-Id: Id69ce23217a62a7198a302cb6878cd63038a49c2

src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/inc/FUiCtrl_EditCopyPasteManager.h

index d842991..0ccfd14 100644 (file)
@@ -34,6 +34,7 @@
 #include "FUiCtrl_Form.h"
 #include "FUiCtrl_Frame.h"
 #include "FUi_EcoreEvas.h"
+#include "FUi_Math.h"
 #include "FUi_Window.h"
 
 #define EDIT_COPY_PASTE_MAGNIFIER 0
@@ -2035,71 +2036,6 @@ _EditCopyPasteManager::Show(void)
 }
 
 bool
-_EditCopyPasteManager::CheckHandleBounds(const Point& point)
-{
-       bool hasCommandButton = false;
-       bool hasParentForm = false;
-       bool hasParentPanel = false;
-       bool showCheck = true;
-       Rectangle commandButtonBounds(0, 0, 0, 0);
-       Rectangle formClientBounds(0, 0, 0, 0);
-       Rectangle panelAbsoulteBounds(0, 0, 0, 0);
-       Rectangle editAbsBounds = __pEdit->GetAbsoluteBounds();
-       Rectangle textObjectBounds = __pEditPresenter->GetTextBounds();
-       editAbsBounds.x += textObjectBounds.x;
-       editAbsBounds.y += textObjectBounds.y;
-       editAbsBounds.width = textObjectBounds.width;
-
-       if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
-       {
-               editAbsBounds.height = textObjectBounds.height;
-       }
-
-       _Toolbar* pCommandButton = __pEditPresenter->GetKeypadCommandButton();
-       if (pCommandButton)
-       {
-               commandButtonBounds = pCommandButton->GetAbsoluteBounds();
-               hasCommandButton = true;
-       }
-       _Form* pForm = __pEditPresenter->GetParentForm();
-       if (pForm)
-       {
-               formClientBounds = pForm->GetClientBounds();
-               hasParentForm = true;
-       }
-
-       _ScrollPanel* pPanel = __pEditPresenter->GetParentPanel();
-       if (pPanel)
-       {
-               panelAbsoulteBounds = pPanel->GetAbsoluteBounds();
-               hasParentPanel = true;
-       }
-
-       if (editAbsBounds.x > point.x || point.x > (editAbsBounds.x + editAbsBounds.width))
-       {
-               showCheck = false;
-       }
-
-       if (editAbsBounds.y > point.y || point.y > (editAbsBounds.y + editAbsBounds.height))
-       {
-               showCheck = false;
-       }
-       if (hasParentForm && (formClientBounds.y > point.y || point.y > (formClientBounds.y + formClientBounds.height)))
-       {
-               showCheck = false;
-       }
-       if (hasParentPanel && (panelAbsoulteBounds.y > point.y || point.y > (panelAbsoulteBounds.y + panelAbsoulteBounds.height)))
-       {
-               showCheck = false;
-       }
-       if (hasCommandButton && commandButtonBounds.Contains(point))
-       {
-               showCheck = false;
-       }
-       return showCheck;
-}
-
-bool
 _EditCopyPasteManager::CheckHandleBounds(const FloatPoint& point)
 {
        bool hasCommandButton = false;
@@ -2140,20 +2076,20 @@ _EditCopyPasteManager::CheckHandleBounds(const FloatPoint& point)
                hasParentPanel = true;
        }
 
-       if (editAbsBounds.x > point.x || point.x > (editAbsBounds.x + editAbsBounds.width))
+       if ((!_FloatCompare(editAbsBounds.x, point.x) && (editAbsBounds.x > point.x)) || (!_FloatCompare(point.x, editAbsBounds.x + editAbsBounds.width) && point.x > (editAbsBounds.x + editAbsBounds.width)))
        {
                showCheck = false;
        }
 
-       if (editAbsBounds.y > point.y || point.y > (editAbsBounds.y + editAbsBounds.height))
+       if ((!_FloatCompare(editAbsBounds.y, point.y) && (editAbsBounds.y > point.y)) || (!_FloatCompare(point.y, editAbsBounds.y + editAbsBounds.height) && point.y > (editAbsBounds.y + editAbsBounds.height)))
        {
                showCheck = false;
        }
-       if (hasParentForm && (formClientBounds.y > point.y || point.y > (formClientBounds.y + formClientBounds.height)))
+       if (hasParentForm && ((!_FloatCompare(formClientBounds.y, point.y) && formClientBounds.y > point.y) || (!_FloatCompare(point.y, formClientBounds.y + formClientBounds.height) && point.y > (formClientBounds.y + formClientBounds.height))))
        {
                showCheck = false;
        }
-       if (hasParentPanel && (panelAbsoulteBounds.y > point.y || point.y > (panelAbsoulteBounds.y + panelAbsoulteBounds.height)))
+       if (hasParentPanel && ((!_FloatCompare(panelAbsoulteBounds.y, point.y) && panelAbsoulteBounds.y > point.y) || (!_FloatCompare(point.y, panelAbsoulteBounds.y + panelAbsoulteBounds.height) && point.y > (panelAbsoulteBounds.y + panelAbsoulteBounds.height))))
        {
                showCheck = false;
        }
index 7219698..e872a59 100644 (file)
@@ -5752,55 +5752,6 @@ _EditPresenter::UpdateComponentInformation(void)
        return r;
 }
 
-/*
-result
-_EditPresenter::UpdateComponentInformation(void)
-{
-       result r = E_SUCCESS;
-
-       if (__isCursorChanged == false)
-       {
-               return r;
-       }
-
-       bool setFirstDisplayLine = true;
-       if (!((__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) || (__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN)))
-       {
-               int firstDisplayY = __pTextObject->GetFirstDisplayPositionY();
-               int totalHeight = __pTextObject->GetTotalHeight();
-               Rectangle displayBounds = __pTextObject->GetBounds();
-               if (totalHeight >= displayBounds.height)
-               {
-                       int textGapFromBottom = displayBounds.height - (totalHeight - firstDisplayY);
-                       if (textGapFromBottom > 0)
-                       {
-                               ScrollText(_CoordinateSystemUtils::ConvertToFloat(-textGapFromBottom));
-                       }
-               }
-
-               Rectangle absCursorBounds(0, 0, 0, 0);
-               CalculateAbsoluteCursorBounds(__cursorPos, absCursorBounds);
-               FloatRectangle floatAbsCursorBounds = _CoordinateSystemUtils::ConvertToFloat(absCursorBounds);
-               setFirstDisplayLine = (IsContained(floatAbsCursorBounds) == false);
-       }
-
-       if (setFirstDisplayLine)
-       {
-               if (__pTextObject->IsChanged())
-               {
-                       __pTextObject->Compose();
-               }
-               __pTextObject->SetFirstDisplayLineIndexFromTextIndex(__cursorPos);
-       }
-
-       __pTextObject->SetCursorIndex(__cursorPos);
-
-       __isCursorChanged = false;
-
-       return r;
-}
-*/
-
 void
 _EditPresenter::ScrollText(float distance)
 {
@@ -9489,15 +9440,16 @@ _EditPresenter::ScrollPanelToCursorPosition(bool show)
        if (upSideGap > 0.0f || downSideGap > 0.0f)
        {
                float gap = 0.0f;
-               float GAP_CORRECTION = __verticalMargin / 2.0f;
+               float topTextMargin = __textObjectBounds.y;
+               float bottomTextMargin = __pEdit->GetBoundsF().height - __textObjectBounds.y -  __textObjectBounds.height;
 
                if (upSideGap > 0.0f)
                {
-                       gap = scrollPosition - (upSideGap + GAP_CORRECTION);
+                       gap = scrollPosition - (upSideGap + topTextMargin);
                }
                else
                {
-                       gap = scrollPosition + (downSideGap + GAP_CORRECTION);
+                       gap = scrollPosition + (downSideGap + bottomTextMargin);
                }
 
                __pParentPanel->SetScrollPosition(gap);
index 3b2a2a4..fd0d77c 100644 (file)
@@ -86,7 +86,6 @@ public:
        void CreateCopyPastePopup(void);
        void CreateHandle(void);
        void Show(void);
-       bool CheckHandleBounds(const Tizen::Graphics::Point& point);
        bool CheckHandleBounds(const Tizen::Graphics::FloatPoint& point);
        bool CheckHandlePosition(bool leftHandle, int cursorPosition);
        void RefreshBlock(bool isLeftHandle = false);