From 3a0e332bcbb81df7de0a571f8b694b20bdbb12be Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Fri, 21 Oct 2016 15:57:11 +0100 Subject: [PATCH] Fix for a single line text's vertical alignment. * Use case: - A TextField with the vertical alignment set to CENTER. - Add some text. It's correctly aligned. - Remove some text with the back space. It aligns the text to the TOP Change-Id: I5c8c6f2bd81d8f78ba5ec2835c1e55531cb99a77 Signed-off-by: Victor Cebollada --- dali-toolkit/internal/text/text-controller-impl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 7b3f2d6..dcb2901 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -2683,6 +2683,12 @@ void Controller::Impl::ClampHorizontalScroll( const Vector2& layoutSize ) void Controller::Impl::ClampVerticalScroll( const Vector2& layoutSize ) { + if( LayoutEngine::SINGLE_LINE_BOX == mLayoutEngine.GetLayout() ) + { + // Nothing to do if the text is single line. + return; + } + // Clamp between -space & 0. if( layoutSize.height > mVisualModel->mControlSize.height ) { -- 2.7.4