From: Bowon Ryu Date: Thu, 4 Mar 2021 05:40:00 +0000 (+0900) Subject: Prevent height adjustment of TextLabel X-Git-Tag: dali_2.0.16~1^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=d6d770b77517d86cf6092e140290cba35fe64d91 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 --- 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.