[NUI] Fix text padding issue
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
index f46d50c..1a0a176 100755 (executable)
@@ -3008,7 +3008,13 @@ namespace Tizen.NUI.BaseComponents
                             setMargin = true;
                         }
 
-                        if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
+                        // The calculation of the native size of the text component requires padding.
+                        // Don't overwrite the zero padding.
+                        bool isTextLayout = (value is Tizen.NUI.BaseComponents.TextLabel.TextLabelLayout) ||
+                                            (value is Tizen.NUI.BaseComponents.TextField.TextFieldLayout) ||
+                                            (value is Tizen.NUI.BaseComponents.TextEditor.TextEditorLayout);
+
+                        if (!isTextLayout && (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0))
                         {
                             // If View already has a padding set then store it in Layout instead.
                             value.Padding = padding;