From adfb146bfa4606266ef22d7ba1f9fff6d2ff4e20 Mon Sep 17 00:00:00 2001 From: zhoukechen Date: Fri, 9 Aug 2024 12:24:12 +0800 Subject: [PATCH] =?UTF-8?q?inline=E9=80=82=E9=85=8D=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=8C=E6=96=87=E5=AD=97=E6=96=B9=E5=90=91?= =?UTF-8?q?=E4=B8=BARTL=E6=97=B6=E5=80=99=E7=95=99=E7=99=BD=E7=A7=BB?= =?UTF-8?q?=E5=88=B0=E5=B7=A6=E8=BE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoukechen Change-Id: I977900da6b87b6477c8db080ab1caea43bec4276 --- .../pattern/text_field/text_field_pattern.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp b/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp index 7d70505b39e..17cfcf14669 100644 --- a/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp +++ b/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp @@ -6066,8 +6066,14 @@ void TextFieldPattern::ApplyInlineTheme() BorderColorProperty inlineBorderColor; inlineBorderColor.SetColor(theme->GetInlineBorderColor()); renderContext->UpdateBorderColor(inlineBorderColor); - layoutProperty->UpdatePadding({ CalcLength(0.0f), CalcLength(theme->getInlinePaddingRight()), CalcLength(0.0f), - CalcLength(0.0f) }); + + if (layoutProperty->GetNonAutoLayoutDirection() == TextDirection::RTL) { + layoutProperty->UpdatePadding({ CalcLength(theme->getInlinePaddingRight()), CalcLength(0.0f), CalcLength(0.0f), + CalcLength(0.0f) }); + } else { + layoutProperty->UpdatePadding({ CalcLength(0.0f), CalcLength(theme->getInlinePaddingRight()), CalcLength(0.0f), + CalcLength(0.0f) }); + } ProcessInnerPadding(); ProcessInlinePaddingAndMargin(); }