X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Ftext%2Ftext-utils-devel.cpp;h=1441dc40d00c34eb30bc33da5cbf8ce651c9973c;hp=97a1b57e2ab1f779baecfb6659cfca920c0cbe27;hb=92cbca2f5bd2e15fa589448d4c884b71f4fef03c;hpb=debd4ef5b35507bac4579dfbb8983b743872c70b diff --git a/dali-toolkit/devel-api/text/text-utils-devel.cpp b/dali-toolkit/devel-api/text/text-utils-devel.cpp index 97a1b57..1441dc4 100644 --- a/dali-toolkit/devel-api/text/text-utils-devel.cpp +++ b/dali-toolkit/devel-api/text/text-utils-devel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -172,7 +172,8 @@ void ShapeTextPreprocess(const RendererParameters& textParameters, TextAbstracti MarkupProcessData markupProcessData(colorRuns, fontDescriptionRuns, - textModel->mLogicalModel->mEmbeddedItems); + textModel->mLogicalModel->mEmbeddedItems, + textModel->mLogicalModel->mAnchors); if(textParameters.markupEnabled) { @@ -1012,8 +1013,12 @@ Size LayoutText(const RendererParameters& textParameters, TextAbstraction::TextR const unsigned int radius = textParameters.radius - static_cast(maxAscenderDescender); // Set the layout parameters. - internalDataModel.textLayoutArea = Size(static_cast(textParameters.textWidth), - static_cast(textParameters.textHeight)); + Size textLayoutArea = Size(static_cast(textParameters.textWidth), + static_cast(textParameters.textHeight)); + + // padding + Extents padding = textParameters.padding; + internalDataModel.textLayoutArea = Size(textLayoutArea.x - (padding.start + padding.end), textLayoutArea.y - (padding.top + padding.bottom)); if(isCircularTextLayout) { @@ -1498,7 +1503,7 @@ Dali::Property::Array RenderForLastIndex(RendererParameters& textParameters) //////////////////////////////////////////////////////////////////////////////// // Layout the text //////////////////////////////////////////////////////////////////////////////// - int boundingBox = textParameters.textHeight; + int boundingBox = textParameters.textHeight - (textParameters.padding.top + textParameters.padding.bottom); textParameters.textHeight = MAX_INT; // layout for the entire area. LayoutText(textParameters, rendererParameters, embeddedItemLayout, internalData);