Prevent height adjustment of TextLabel 16/254516/1
authorBowon Ryu <bowon.ryu@samsung.com>
Thu, 4 Mar 2021 05:40:00 +0000 (14:40 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Thu, 4 Mar 2021 05:47:51 +0000 (14:47 +0900)
Cursor position issue occurs when the text control is editable.
isEditable flag prevents wrong resizing in TextLabel.

Change-Id: I15eb8ec37bead595caaf600f9a1f7163c3c98bcd
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
dali-toolkit/internal/text/text-controller-relayouter.cpp

index 8888859..a900601 100644 (file)
@@ -651,7 +651,9 @@ void Controller::Relayouter::CalculateVerticalOffset(Controller& controller, con
     layoutSize.height = defaultFontLineHeight;
   }
 
-  if (layoutSize.height != defaultFontLineHeight)
+  // Whether the text control is editable
+  const bool isEditable = NULL != impl.mEventData;
+  if (isEditable && layoutSize.height != defaultFontLineHeight)
   {
     // This code prevents the wrong positioning of cursor when the layout size is bigger/smaller than defaultFontLineHeight.
     // This situation occurs when the size of placeholder text is different from the default text.