Merge "[AT-SPI] Use WeakHandle<Actor> in Accessible objects" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / text / text-utils-devel.cpp
index 97a1b57..1441dc4 100644 (file)
@@ -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<unsigned int>(maxAscenderDescender);
 
   // Set the layout parameters.
-  internalDataModel.textLayoutArea = Size(static_cast<float>(textParameters.textWidth),
-                                          static_cast<float>(textParameters.textHeight));
+  Size textLayoutArea = Size(static_cast<float>(textParameters.textWidth),
+                             static_cast<float>(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);