From d6d770b77517d86cf6092e140290cba35fe64d91 Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Thu, 4 Mar 2021 14:40:00 +0900 Subject: [PATCH 1/1] Prevent height adjustment of TextLabel 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 --- dali-toolkit/internal/text/text-controller-relayouter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dali-toolkit/internal/text/text-controller-relayouter.cpp b/dali-toolkit/internal/text/text-controller-relayouter.cpp index 8888859..a900601 100644 --- a/dali-toolkit/internal/text/text-controller-relayouter.cpp +++ b/dali-toolkit/internal/text/text-controller-relayouter.cpp @@ -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. -- 2.7.4